- The first Regular Expression Library on the Web!

Please support RegExLib Sponsors


Regular Expression Details

Title Test Find Pattern Title
will match free floating valid protocol + urls in text ... will not touch the ones wrapped in a tag, so that you can auto-link the ones that aren't :) couple of things to know : 1. if the url is next to a tag this won't work (eg : <br>, the url must either start with a \s, \n or any character other than >. 2. the pattern will match the preceding \s and \n too, so when you replace put them back in place $1 will either be \s or \n, $2 will be the exact match vb usage : set re = New RegExp re.Pattern ="(\s|\n|^)(\w+://[^\s\n]+)" strResult = re.Replace(strText, "$1<a href='$2' target='_new'>$2</a>")
Matches | | gopher://asdfasd.asdfasdf
<a href=""></a> | <br>http://www.acme.
Author Rating: The rating for this expression. ic onur
Your Rating
Bad Good

Enter New Comment

Spammers suck - we apologize. Please enter the text shown below to enable your comment (not case sensitive - try as many times as you need to if the first ones are too hard):

Existing User Comments

Copyright © 2001-2018, | ASP.NET Tutorials