Topic: Regex (Page 1 of 1) Pages that link to <a href="" title="Pages that link to Topic: Regex (Page 1 of 1)" rel="nofollow" >Topic: Regex <span class="small">(Page 1 of 1)</span>\

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=""></a> robert </p>
<p> sdlksaf lsafdh robert </p>

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

Thank you.

Paranoid (IV) Inmate

From: Florida
Insane since: Mar 2005

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




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

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 <


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: Remember Me On This Computer
Your Text:
Options: Show Signature
Enable Slimies
Enable Linkwords

« BackwardsOnwards »

Show Forum Drop Down Menu