What I need:
I have a string like this:
Bike’s: http://website.net/bikeurl Toys: http://website.net/rc-cars
Calendar: http://website.net/schedule
I want to match the word I specify and the first URL after it. So if i specify the word as "Bike" i should get:
Bike’s: http://website.net/bikeurl
Or if possible only the url of the Bike word:
Or if I specify Toys I should get:
or if possible
What I am using:
I am using this regex:
(Bike)(.*)((https?|ftp):/?/?)(?:(.*?)(?::(.*?)|)@)?([^:/\s]+)(:([^/]*))?(((?:/\w+)*)/)([-\w.]+[^#?\s]*)?(\?([^#]*))?(#(.*))?
Result:
It is matching:
Bike’s: http://website.net/bikeurl Toys: http://website.net/rc-cars
I only want:
Bike’s: http://website.net/bikeurl
I am not a regex expert, I tried using {n} {n,} but it either didn't match anything or matches the same
I am using .NET C# so I am testing here http://regexhero.net/tester/