Title |
Test
Find
Pattern Title
|
Expression |
<a\s*.*?href\s*=\s*['"](?!http:\/\/).*?>(.*?)<\/a> |
Description |
Finds all local links, but doesnt match on external links.
Use replace with $1 to leave the link text but remove the link. |
Matches |
<a href='locallink.htm'>my local link</a> | <a title='click here' href="/a/local |
Non-Matches |
<a href='http://www.site.com/page.htm'>www.site.com</a> | <a href='http://www.site.co |
Author |
Rating:
Not yet rated.
james mountain
|
Source |
peter lushpay (lushpay.com) |
Your Rating |
|
Title: Incorrectly stops at <a href="/local>foo"> before foo
Name: Randal L. Schwartz
Date: 3/9/2005 10:20:25 AM
Comment:
Do not parse HTML with regex. It's a complex problem. Use a real HTML parser.