[solved] Negative regex / subdomain
|
May. 30, 2010, 12:29 AM
(This post was last modified: May. 30, 2010 01:02 PM by anewuser.)
Post: #1
|
|||
|
|||
[solved] Negative regex / subdomain
Can somebody please help me with a regex that matches links to all Wikipedia domains but en.wikipedia.org? For example, I want to filter:
Code: http://it.wikipedia.org/wiki/Lala Code: http://es.wikipedia.org/wiki/Lala Code: http://en.wikipedia.org/wiki/Lala I've tried this, but it didn't work: Code: /<a href="http://(?!en)\.wikipedia\.org/.*?".*?</a>/ |
|||
May. 30, 2010, 01:01 PM
Post: #2
|
|||
|
|||
RE: Negative regex / subdomain
I've managed to do what I wanted by creating two filters. The first one adds an extra attribute to tags that contain links to en.wikipedia.org, and the second one matches all remaining Wikipedia links.
Code: search="/<a href=\"http://en\\.wikipedia\\.org/" Code: search=<<END PS: I may have stripped something out while editing my code to post it here, but the full thing works. :p |
|||
May. 30, 2010, 01:09 PM
(This post was last modified: May. 30, 2010 01:12 PM by Graycode.)
Post: #3
|
|||
|
|||
RE: Negative regex / subdomain
Great you were able to figure it out. I had a suggestion about whether or not you needed to escape the slashes, but apparently that was wrong. Good luck!
|
|||
« Next Oldest | Next Newest »
|