W3C home > Mailing lists > Public > www-style@w3.org > March 1998

Re: OPINIONS WANTED: regexps in CSS?

From: Carl Johan Berglund <carl.johan.berglund@adverb.se>
Date: Tue, 10 Mar 1998 12:40:14 +0100
Message-Id: <l03102806b12ad376c399@[]>
To: Bert Bos <Bert.Bos@sophia.inria.fr>
Cc: www-style@w3.org
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

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:26:46 UTC