OPINIONS WANTED: regexps in CSS? (Re: Suggestion for Attribute Selectors)

Everybody's opinion wanted!

Ian Hickson writes:
 > It would be much better to have one much more comprehensive syntax based on
 > a regular expression model.
 > The advantages are actually numerous:
 >  * Regular expressions have been in use for *years*, so the technology is
 > mature (i.e. can be efficient).
 >  * They are commonly used in many applications, so the learning curve for
 > both implementors and users is shallow.
 >  * A single, comprehensive and self-consistent regular expression scheme
 > would actually do more for clarity than adding more and more attribute
 > selectors in future specs.

Well, personally I like regexps very much, but I have some doubt as to
the number of people that can read and write them.

But maybe there are other opinions on this list. So let's ask:

QUESTIONAIRE:

 1. will this regexp-selector:

        COL[WIDTH="^ *[0-9]+(\.[0-9]+)? *(\*|px|%)? *$"]

    match this HTML?

        <COL width=".9px">

 2. please send me your attempt at writing a regexp that matches "fr",
    "fr-ca", "fr-fr", "fr-ca-quebec" (in both upper- and lowercase),
    etc, but not "franc" or "free" or "fr!" or "de-fr".

 3. how easy is it for you to write such a regexp?

 4. if you can't write it, would it be hard to learn, do you think?

 5. can you estimate how easy/hard it is for other people?





 >  I once read that a truly great utility was one which was used for a
 > purpose never dreamed of by the designer - the way the spec is now this is
 > not likely to happen with attribute selectors.

Donald Knuth, in the preface to Metafont, I believe.


Bert
-- 
  Bert Bos                                ( W 3 C ) http://www.w3.org/
  http://www.w3.org/people/bos/                              W3C/INRIA
  bert@w3.org                             2004 Rt des Lucioles / BP 93
  +33 (0)4 93 65 76 92            06902 Sophia Antipolis Cedex, France
  +33 (0)4 92 38 76 92 (<--- after 5 Jan 1998)

Received on Tuesday, 10 March 1998 05:27:26 UTC