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

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

From: Stephanos Piperoglou <sp249@cam.ac.uk>
Date: Wed, 11 Mar 1998 17:46:00 +0000 (GMT)
To: Sevo Stille <sevo@inm.de>
cc: Victoria Rosenfeld <jiggy@holly.ColoState.EDU>, www-style@w3.org
Message-ID: <Pine.LNX.3.96.980311174010.18640F-100000@teatime.joh.cam.ac.uk>
On Wed, 11 Mar 1998, Sevo Stille wrote:

> Now, it certainly does not make sense to invent a new method. While there are some
> more complex forms of pattern matching syntax extending RE (e.g. perl, agrep),
> we'll have to keep to some common level. Going by what is implemented in common
> software and across the WWW, I don't see any options beyond strictly literal
> matching (which would require multiple entries in style sheets to cope with
> language variants), shell metacharacters (more common than REs, but prone to fail
> in ambiguous cases) and REs (which would replace the shell "*" with ".*" for
> elementary wildcard matches - something even beginners should be able to
> understand).

THat's a nice idea. Use globbing (* and ?) as a basic format that everyone
can understand (EVERYONE knows globbing) and have regexps (possible
contained in forward slashes, as is usually done, not only in Perl) as an
optional extension.

Actually, what I think should happen is change the meaning of the = and ~=
operators (~= is traditionally a "is like" operator, I think) so that

foo[bar=glob]
Examples:
DIV[CLASS=Separator]
DIV[CLASS=Separator*]
DIV[CLASS=*section*]

Will match all foo elements with attribute bar matching the glob pattern,
while the ~= (which would no longer be needed in the current context since
you can express more or less the same thing using a glob pattern) with

foo[bar=regexp]

And do what you'd expect it to do.

-- Stephanos Piperoglou -- sp249@cam.ac.uk -------------------
All I want is a little love and a lot of money. In that order.
------------------------- http://www.thor.cam.ac.uk/~sp249/ --
Received on Wednesday, 11 March 1998 12:48:05 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:53:54 GMT