W3C home > Mailing lists > Public > www-style@w3.org > July 2011

Re: CSS regexes

From: Alexander Shpack <shadowkin@gmail.com>
Date: Mon, 18 Jul 2011 23:23:27 +0300
Message-ID: <CAK4xKX=+DOVeZYywm_27kqzot-x04GsPHALRAczcvXJKqFWy4g@mail.gmail.com>
To: jwl@worldmusic.de
Cc: www-style@w3.org
On Wed, Jul 13, 2011 at 9:00 PM, Joergen W. Lang <joergen_lang@gmx.de> wrote:
> Dear CSSWG,
>
> are there any plans to implement one or the other form of regular expression
> in CSS?
>
> I know that attribute selectors do some basic RE matching. But for anonymous
> boxes (a.k.a. plain text) authors are still limited to using <span> and
> friends.
>
> To style the third "word" (combination of 'word' characters/syllables/...)
> in a paragraph one could write:
>
> p::regex(/^(?:\w+\s+){2}(\w+)/) {
>  background-color: #cf6;
> }
>
> Or maybe she wants to give quotation marks a special treatment:
>
> h1::regex(/['""„“”«»’,]/g) {
>  font-family: Baskerville, "Book Antiqua", serif;
>  font-style:  italic;
> }
>
> After reading the thread regarding the '::first-word pseudo element' [1] I
> can see there are a lot of implications and questions. One argument against
> ::regex() was that it selects actual content.
>

This simple feature may complete replace ::first-letter
pseudo-element... I vote for it!

-- 
s0rr0w
Received on Monday, 18 July 2011 20:23:58 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:42 GMT