-3

I need a string to select everything all html tags text numbers everything, except the random occurrence of words found within the anchor closing tag, of this line rel="bookmark">RANDOM WORDS</a></h1>

I tried the string [<0-9a-zA-z/=|"-:.*?>] which select's literally everything, it find's that's okay, but I require one that exclude's RANDOM WORDS, in the selection that's found within the line mentioned above.

1 Answers1

1

Regex's are not the right tool for this job. Please consider using an XML/HTML DOM parser and extract the information you need that way!

The reason you're having trouble with crafting a RegEx to accomplish this task is because the HTML markup language is not regular - hence, not suitable for processing with regular expressions!

Mike Dinescu
  • 51,717
  • 14
  • 111
  • 144