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 +s" varies between the different document types, but a good rule of thumb +is 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 +idea to always put quote marks around your attribute values. It is never wr +ong 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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Understanding this particular Regex.
by tobyink (Canon) on May 05, 2013 at 20:54 UTC | |
by ww (Archbishop) on May 06, 2013 at 15:14 UTC | |
by tobyink (Canon) on May 06, 2013 at 16:12 UTC |