Description |
Variable 1 = "complete attribute and value".
Variable 2 = "attribute value only".
For meeting compliance with W3C AA rules, I've been using this in a simple HTML parser to convert certain background tags from the deprecated 'bgcolor' attribute to now using a 'style=background:' and the passed colour. This had to be only on hexadecimal values for my current needs.
Later modifications :
1. Only for certain tags (eg. td,tr,table).
2. If matching an opening apostrophe/quotation mark, only capture variable if there is a closing one.
|