Reputation: 1984
I have the following two strings:
http://test1/foo
http://test2/foo_bar
I want to get foo in the first example, but not in the second example; in other words just the foo as is not if we append something to it
I tried the following regular expression:
/foo[^.]/g
but it is catching both "foo"
Thanks
Upvotes: 1
Views: 58