> Hello, > > I need to find all % characters in a string that are not element attributes. > for syntax instance: > > <div width="100%">some value%</div> > > I need a regex that matches the % in value% but not in 100% because it is > within angle braces. > > Is it possible or more complicated than regex? >
As your second message indicates, doing HTML parsing with simple regexes is generally difficult and leads to headaches. I would suggest using one the various HTML parsing modules available from CPAN. HTML::TokeParser::Simple has served me very well in the past (and still does). http://search.cpan.org/~ovid/HTML-TokeParser-Simple-2.2/Simple.pm http://danconia.org -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>