I want to be able to match any tag which is of the form <area
…> that does NOT contain a “mailto:” href. The grouping is for some
substitution that I’m doing.
I want to be able to match any tag which is of the form <area
…> that does NOT contain a “mailto:” href. The grouping is for some
substitution that I’m doing.
Let’s try
<area [^>]*?etc.
You will find out that this will solve this particular problem but
creates
other ones like e.g. with this HTML
unless, and you tell me, that is not legal HTML
anyway I feel that maybe Regexen are not the right tool for your task
anymore, dunno.
But maybe you can work with the above regex anyway.
Cheers
Robert
What I find is that this pattern will successfully handle most area
So I was just typing and typing and typing…
Glad Ur happy with it.
Robert
–
Deux choses sont infinies : l’univers et la bêtise humaine ; en ce qui
concerne l’univers, je n’en ai pas acquis la certitude absolue.
Albert Einstein
Robert,
I am pretty sure that it’s illegal to put a “>” in an HTML attribute
(you would achieve the desired affect with >).
I agree that perhaps regexen are not the best way to manipulate this -
however, I’ve already been down the path of using a HTML parser
(RubyfulSoup/htmltools) and trying to output the resulting parse tree.
Unfortunately, that parser attempts to “fix” the HTML for me and when I
attempt to render the fixed HTML in a browser, it is “too fixed” for the
browser to handle.
So unfortunately, I’m forced to accept what I get and only change it so
that I don’t break any existing stuff.
Hence, I’m using regexen to do my write - manipulation.
I am pretty sure that it’s illegal to put a “>” in an HTML attribute
Well than you might be flying with your solution.
(you would achieve the desired affect with >).
I agree that perhaps regexen are not the best way to manipulate this -
however, I’ve already been down the path of using a HTML parser
(RubyfulSoup/htmltools) and trying to output the resulting parse tree.
Unfortunately, that parser attempts to “fix” the HTML for me and when I
attempt to render the fixed HTML in a browser, it is “too fixed” for the
browser to handle.
Not surprised
So unfortunately, I’m forced to accept what I get and only change it so
that I don’t break any existing stuff.
Hence, I’m using regexen to do my write - manipulation.
I was not thinking about throwing them away altogether but maybe
scanning
from one attribute to another inside a tag.
But thinling about me personal expirence sometimes I got threw with
grep!