Click to See Complete Forum and Search --> : [RESOLVED] Grep help!


cuttyfranks
08-22-2008, 03:08 PM
Not sure if I have the right forum for this.

I'm trying to replace
<strong>—GenericFirstName Last</strong>

with

Nothing-trying to take it out completely.

I'm using Grep with find and replace.

Thanks in advance.

scragar
08-22-2008, 03:24 PM
grep using the perl syntax right?
<strong>.*?</strong>

should work.

cuttyfranks
08-22-2008, 03:36 PM
hmmm. close. your code seems to getting rid of all the strong tags.

what i'm looking for is something a little more specific. i shoulda been clearer, sorry.

what i'm looking for is something to get rid of all the strong tags with an mdash or ndash, then the name.

so for example, i'd like for my search to look for
anything with

<strong>-Name Last</strong>
AND
<strong>—Name Last</strong>

but keeping all the

<strong>whateverwhatever</strong>

thanks again :)

scragar
08-22-2008, 04:05 PM
<strong>-.*\s.*</strong>
will match anything starting with a - and containing 2 or more words(if you only want to match 2 words I recomend:<strong>([^\s]+)\s([^\s]+)</strong>)

cuttyfranks
08-22-2008, 05:04 PM
winner!

<strong>([^\s]+)\s([^\s]+)</strong>

thank you! :)