Regex helper

Posted

Update: The original link is now dead. Here's another regex tester to try. I recently had to come up with a regular expression that I could run against an HTML string that would only affect content, not tags or attribute values. I'm no regex master, so after a whole lot of failed attempts, I turned to the Google and found this invaluable regex tester, which also had a bunch of other problems already solved (click on the Samples link at the top). Here's the answer to my particular question that day:

/(?![^)\b(text_to_match)\b/
I hate when it's that simple.

Filed under  //  regex  
Comments (4)
Posted