Closed Thread Icon

Topic awaiting preservation: Regex (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=29411" title="Pages that link to Topic awaiting preservation: Regex (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: Regex <span class="small">(Page 1 of 1)</span>\

 
u-neek
Bipolar (III) Inmate

From: Berlin, Germany
Insane since: Jan 2001

posted posted 08-04-2007 21:38

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

posted posted 08-04-2007 22:26

s/mailto:robert/mailto:asdfbeans

s/robert/foo

s/mailto:asdfbeans/mailto:robert

Skaarjj
Maniac (V) Mad Scientist

From: :morF
Insane since: May 2000

posted posted 08-05-2007 16:05

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

posted posted 08-06-2007 18:32

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.

« BackwardsOnwards »

Show Forum Drop Down Menu