Topic: Regex Pages that link to <a href="https://ozoneasylum.com/backlink?for=29411" title="Pages that link to Topic: Regex" rel="nofollow" >Topic: Regex\

 
Author Thread
u-neek
Bipolar (III) Inmate

From: Berlin, Germany
Insane since: Jan 2001

IP logged posted posted 08-04-2007 21:38 Edit Quote

Hello there! It's been a while.

I am searching for a regular expression, that matches the word "robert" in the following string, except the "robert" in the href:

<p>jhg hkg jkh robert <a href="mailto:robert.test@email.com">robert.test@email.com</a> robert </p>
<p> sdlksaf lsafdh robert </p>

To summarize this: search all "robert", except the ones inside <>.

Thank you.

reisio
Paranoid (IV) Inmate

From: Florida
Insane since: Mar 2005

IP logged posted posted 08-04-2007 22:26 Edit Quote

s/mailto:robert/mailto:asdfbeans

s/robert/foo

s/mailto:asdfbeans/mailto:robert

Skaarjj
Maniac (V) Mad Scientist

From: :morF
Insane since: May 2000

IP logged posted posted 08-05-2007 16:05 Edit Quote

Or maybe*:

/<a href=\"(.*?)\">.*?robert.*?/

note the 'maybe'. I haven't tested this.


Justice 4 Pat Richard

hyperbole
Paranoid (IV) Inmate

From: Madison, Indiana
Insane since: Aug 2000

IP logged posted posted 08-06-2007 18:32 Edit Quote

Based on the data you've given and the stated problem.

The following expression will find all the "robert"s between > and <

code:
>[^<>]*robert



If all you want to do is find them, that expression will work. If you want to replace them all with something, I need to know more about what you're trying to do, what language you're using, etc.

.



-- not necessarily stoned... just beautiful.



Post Reply
 
Your User Name:
Your Password:
Login Options:
 
Your Text:
Loading...
Options:


« BackwardsOnwards »

Show Forum Drop Down Menu