in reply to Reg expression to replace URLs with Anchor tags in Tweets
Your regexp is capturing everything from the 'http' string, hence your regexp:
should read:s/(http.*)/<a href=\"\1\">\1<\/a>/;
In that way, the regexp will capture everything from the 'http' string to (but not including) the next whitespace char.s/(http\S+)/<a href="$1">$1<\/a>/;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Reg expression to replace URLs with Anchor tags in Tweets
by halfbaked (Sexton) on Apr 19, 2009 at 00:15 UTC |