Re: OPINIONS WANTED: regexps in CSS?

At 11.27 +0100 98-03-10, Bert Bos wrote:
>Everybody's opinion wanted!
> 1. will this regexp-selector:
>        COL[WIDTH="^ *[0-9]+(\.[0-9]+)? *(\*|px|%)? *$"]
>    match this HTML?
>        <COL width=".9px">

No, it won't, since the first "[0-9]+" in the regexp won't match the
nothingness before the "." in the HTML. That regexp would match the
following HTML:

	<COL width="0.9px">

The following regexp-selector would match your HTML (unless I missed

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

> 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".

What about:

	^ *(fr|FR)(-[A-Za-z]+)* *$

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

Simple enough. Took me two minutes or something.

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

Easy enough for those wanting to author advanced style sheets.

Best regards
Carl Johan Berglund

   Adverb Information

Received on Tuesday, 10 March 1998 06:41:06 UTC