Page 1 of 1

Need RegEx to find a string NOT containing a .

Posted: Mon Dec 07, 2009 8:11 am
by InteXX
I have an HTML document that contains ~300 instances of this string:

Code: Select all

</p>\n  </div>
I need to search and find--one at a time, so I can manually edit the markup as I go--each instance that is NOT preceded by a period.

Ex:

Code: Select all

{a-z,A-Z,0-9}</p>\n  </div>
Is found,

Code: Select all

.</p>\n  </div>
Is not.

Am I asking for too much or can this be done?

Thanks,
Jeff

Posted: Mon Dec 07, 2009 8:16 am
by InteXX
It seems I answered my own question merely by asking it:

Code: Select all

[a-zA-Z0-9]</p>\n  </div>
Thanks, nice to meet ch'all! :D

Posted: Mon Dec 07, 2009 10:01 am
by ben_josephs
More generally, [^.] matches any single character that is not a period (and is not a newline).

Posted: Mon Dec 07, 2009 10:15 am
by InteXX
That's even better, thanks.