in reply to Re^2: Understanding this particular Regex.
in thread Understanding this particular Regex.
Last time I chased this kinda' question thru the specs themselves, the validator came up short of fully satisfying the w3c 4.01 transitional spec and even farther short of the strict spec.
The validator, for example, blesses your code ("validates") without error (albeit, with warnings) despite the lack of <head>...</head>, <body>...</body> and <</html> tags... and that's using the transitional spec which allows no such things.
If you try it with strict, upload mode, and add:
<table width = 17%>
you'll see even the validator lets fly:
If this error occurred in a script section of your document,
you should probably read this FAQ entry.
Error Line 9, Column 18: an attribute value must be a literal
unless it contains only name characters
<table width = 17%>
You have used a character that is not considered a "name character"
in an attribute value. Which characters are considered "name character
varies between the different document types, but a good rule of thumb
that unless the value contains only lower or upper case letters in the
range a-z you must put quotation marks around the value. In fact,
unless you have extreme file size requirements it is a very very good
to always put quote marks around your attribute values. It is never wr
to do so, and very often it is absolutely necessary."
Your regex and the accompanying statement are correct, as far as they go, but are most closely applicable to webmonkeys (yeah, been there; done that.) writing for NS or IE4 style browsers. Today, however, you'll find widths (for example and where used) expressed as ems, ens (no problem as long as you don't introduce spaces) or as percentages... as in the example above. The "%" sign is an example of a warstopper.
A little knowledge is a dangerous thing; categorical statements based on incomplete knowledge are apt to be even more so.