search and replace in html text



hi

i want to search for a pattern in html text and replace only those occurences that are not enclosed inside <> (html tag, not perl operator).
i was thinking of something like


$string =~ s/$pattern/test for <> or similar; else replace/ge;

another way could be splitting $string into an array, where html tags and other text are separated elements, but i don't know how to do this either

sounds like an easy task but i haven't managed to accomplish it yet.
thanks for your help

matthias

.



Relevant Pages

  • Re: RegExp split for Spell Check
    ... So I need a pattern that matches any space or carriage return that is ... Splitting this text should return an array containing: ... Either you have a weird idea of "html tag", ...
    (comp.lang.javascript)
  • Re: RegExp split for Spell Check
    ... So I need a pattern that matches any space or carriage return that is ... Splitting this text should return an array containing: ... Either you have a weird idea of "html tag", ...
    (comp.lang.javascript)