Any questions involving matching text strings to patterns - the pattern is called a "regular expression."
Moderator: General Moderators
cs-web
Forum Commoner
Posts: 27 Joined: Fri Mar 11, 2005 11:57 am
Post
by cs-web » Wed Oct 26, 2005 3:45 pm
Hi I made this simple regex pattern to match URLs so I can convert them to links.
But when I put it to work on this text
It matches
I dont see how its matching the <br on the end?? If anybody can helf it would be brilliant.
Chris
programmermatt
Forum Commoner
Posts: 65 Joined: Tue Mar 15, 2005 5:03 pm
Contact:
Post
by programmermatt » Wed Oct 26, 2005 4:11 pm
This works for me:
Though I would personally:
cs-web
Forum Commoner
Posts: 27 Joined: Fri Mar 11, 2005 11:57 am
Post
by cs-web » Wed Oct 26, 2005 4:23 pm
you suggestion wont match the URL in
and matches
in the original text and so still matches "<" at the end.
shoebappa
Forum Contributor
Posts: 158 Joined: Mon Jul 11, 2005 9:14 pm
Location: Norfolk, VA
Post
by shoebappa » Wed Oct 26, 2005 11:29 pm
What about:
I may have escaped too much, but I think your problem is escaping things...
Or: