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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find BBCode Hyperlink Locator
Expression
(\[url=?"?)([^\]"]*)("?\])([^\[]*)(\[/url\])
Description
This expression locates all BBCode style hyperlinks and breaks out the URL and linked text components. The URL attribute can be double-quoted or not, or not present at all. URL attributes (if present) are at $2, linked text is at $4.
Matches
[url=http://www.web.com]link text[/url], [url="http://www.web.com"]link text[/url], [url=banana]link text[/url]
Non-Matches
[url=http://www.web.com]link text, [url=http://www.web.com"][/url], [url][/url], [url="http:www.web.com"]some text[url]
Author Rating: Not yet rated. Doug Vanderweide
Source
Your Rating
Bad Good

Enter New Comment

Title
 
Name
 
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, RegexAdvice.com | ASP.NET Tutorials