HTML lowercaser

In the ages of Netscape 3.0 people were used to write HTML tags in upper case (e.g. <B>Bold text</B>). However with the introduction of XML and XHTML these tags are no more valid and only a lowercase tags can be used. On some websites it was necessary to convert thousands of documents from the old HTML to the shiny new XHTML. While it's still a boring manual work, at least converting the upper case tags to lower case can be done automatically. And this is the only purpose of this short program.

It works as a filter - feed your old HTML file to the input and read it from the output.

It intentionally doesn't convert in-line programs in PHP and ASP as well as strings in the tags (like URLs), because these could be case sensitive.

Get the LEX source
lowercaser.l (Colorized)
Compile
$ flex lowercaser.l
$ gcc -o lowercaser lex.yy.c -lfl
View the test file
somefile-uc.txt with uppercase HTML tags
Convert it
$ ./lowercaser < somefile-uc.txt > somefile-lc.txt
And check if it worked
somefile-lc.txt with lowercase HTML tags
Place for your feedback...
No messages entered so far.