Rob Dixon wrote: > Jack Gates wrote: >> On Friday 26 September 2008 02:52:45 pm Rob Dixon wrote: >>> Jack Gates wrote: >>>> On Friday 26 September 2008 01:20:29 pm Rob Dixon wrote: >>>>> Jack Gates wrote: >>>>>> >>>>>> s!(<|</)([^\!][A-Z0-9 ]+>)!$1\L$2\E!g; >>>>>> or >>>>>> s/(<|<\/)([^!][A-Z0-9 ]+>)/$1\L$2\E/g; >>>>>> >>>>>> The RE above captures and replaces all HTML tags with >>>>>> lowercase as desired except for any tag that has only one >>>>>> letter such as <P>, <B> or <I> >>>>>> >>>>>> It will get the </B>, </P> and </I> >>>>>> >>>>>> It properly ignores the <!DOCTYPE> tag >>>>>> >>>>>> What is the correct way to write the above RE? >>>>> >>>>> HTML tag names can't contain spaces, so you want >>>>> >>>>> s|(</?)([A-Z][A-Z0-9]*)|$1\L$2|g; >>>> >>>> Thanks for the effort. Your RE does not work as well as what I >>>> have. >>>> >>>> HTML tags can contain spaces. >>>> You forgot about >>>> <p id="something" class="something"> >>> >>> No, I didn't. The tag name is 'p' and it has no spaces in it. The >>> tag has two attributes named 'id' and 'class'. They don't have >>> spaces in them either. >>> >>> If you prefer yours that doesn't work on tags with >>> single-character names just because it happens to also modify the >>> first attribute name then go ahead and use it. >>> >>> I'm pretty sure there is no simple way to change the case of a >>> tag's name and all its attribute names while leaving the >>> attribute values intact. >> >> I was not talking about the HTML tag name but the entire tag which >> includes everything in it. >> >> And yes I have a RE that does exactly what I want with John's help. >> >> Rob, PLEASE STOP CCing ME. I am subscribed to the list. > > That's fine, I shall stop trying to help you altogether. You are very rude and > don't want to accept correction.
I am posting this again for the consideration of the moderators. This is the worst example of asking for help I have ever seen. Jack: - The resolution that you chose was crude and applicable only to your example - You don't appear to understand what an HTML tag name is - You asked and got very good free help. To expect to fine-tune the presentation of that help without paying a thing is pompous in the extreme Rob -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/
