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

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 UTC