JDT |
FREE Downloads |
|
Convert HTML Tag Names to Lowercase |
||||
|
This piece of sample code shows how to use Perl and regular expressions to convert HTML tag names to lowercase. Here is the regular expression: $line =~ s/<(.*?)>/<\L$1>/g; This regular expression will convert all opening and closing tags to lowercase, including tags that have parameters. For example, the following tags will all be converted to lowercase. <HTML>...</HTML> will become <html>...</html> <P ALIGN="CENTER">...</P> will become <p align="center">...</p> <TD WIDTH="100%" VALIGN="MIDDLE">...</TD> will become <td width="100%" valign="middle">...</td> Author: Backrubber Go back to Perl Tutorials home page Go back to Tutorials home page
|