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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Pattern Title
Expression
<[aA][ ]{0,}([a-zA-Z0-9"'_,.:;!?@$&()%=/ ]|[-]|[ \f]){0,}>((<(([a-zA-Z0-9"'_,.:;!?@$&()%=/ ]|[-]|[ \f]){0,})>([a-zA-Z0-9"'_,.:;!?@$&()%=/ ]|[-]|[ \f]){0,})|(([a-zA-Z0-9"'_,.:;!?@$&()%=/ ]|[-]|[ \f]){0,})){0,}
Description
I wrote this sweet little (well, not so little really) reg to extract links from an HTML source.... it is very robust, give it a try. The only limitation I have discovered is that it can't match invalid HTML...
Matches
<a href='javascript:functionA();'><i>this text is italicized</i></a>
Non-Matches
<A href='#'><P</A></P>
Author Rating: Not yet rated. Brian Webb
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

Title: parsing html with regex
Name: TimKanski
Date: 2/24/2017 1:01:58 AM
Comment:
Parsing HTML with Regex is highly discouraged.


Title: Works Great!
Name: John Jonas
Date: 3/12/2004 1:53:26 PM
Comment:
I'm writing a site map creator with php and this regex works great. The creator will soon be available on <a href="http://www.jonasfam.com">the Jonas Family Website</a>.


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