RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Expressions by User

   Displaying page 1 of 1 pages; Items 1 to 1
Title Test Details Matching urls in free text
Expression
((www|http)(\W+\S+[^).,:;?\]\} \r\n$]+))
Description
A regular expression which allows me to find strings of text floating around in free text that are in fact URLs. I need to tag these as <url>www.bmj.com/advice</url>. The problem has been allowing special characters in the url, but not mixing them up with genuine punctuation marks at the end of the url in the text-e.g. '.' or '?' or ) or ';' etc)
Matches
www.bmjpg.com/advice&search=?light+dark
Non-Matches
www.bmjpg.com/advice&search=?light+dark?
Author Rating: The rating for this expression. Sean Harrop
   Displaying page 1 of 1 pages; Items 1 to 1

Copyright © 2001-2024, RegexAdvice.com | ASP.NET Tutorials