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 |
|
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>.