[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Sheflug] quick Reg exp exercise



> #!/usr/bin/perl
>
> while (<>) {
>    s/<([A-Za-z0-9]*) /"<" . lc($1) . " "/ge;
>    s/<([A-Za-z0-9]*)>/"<" . lc($1) . ">"/ge;
>    s/<\/([A-Za-z0-9]*)>/"<\/" . lc($1) . ">"/ge;
>    print;
> }
> ## End of script
>
> Save, chmod, and call as:
> 	/path/to/script.pl < input.html > output.html
>
> Caveats: This is the first perl I've written in about a year,

I can work it out from there I think.  Not sure if this will effect XML tags
that (actually I know it will effect XML tags but I'm not sure if they are
case sensitive, but then if it changes all of them it won't matter unless
someone has coded them with the same letters using case to differentiate
which would be silly but not unheard of).

Thanks to those that responded with ideas.  I'll test them out and see what
I get.  The validator was the one on the w3c website.  There is another one
called cynthia that tests more for accessibility.  Not sure whether rits
worth it but I would like to put their logos on the bottom of my pages to
show that I've gone to the effort to make it right.  I like doing things
right when there is a choise.

If anyone knows of a UK accessibility testing validator page I'd be
interested to know because I think Cynthia is American.

Chris Johnson
(No not that one, the other one!)
(running SUSE 9, 512MB PIII 600 (ish))

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.712 / Virus Database: 468 - Release Date: 27/06/2004


___________________________________________________________________

Sheffield Linux User's Group -
http://www.sheflug.co.uk/mailfaq.html

  GNU the choice of a complete generation.