[PATCH xfree86] Signed-off-by: Oleh Nykyforchyn <oleh.nyk at gmail.com>
Peter Hutterer
peter.hutterer at who-t.net
Tue May 24 23:14:42 PDT 2011
On Mon, May 23, 2011 at 10:23:24AM +0300, Oleh Nykyforchyn wrote:
> On Mon, 23 May 2011 12:55:20 +1000
> Peter Hutterer <peter.hutterer at who-t.net> wrote:
>
> > On Fri, May 20, 2011 at 04:30:20PM -0700, Dan Nicholson wrote:
> > > We had this conversation before. I had a patch where you specified an
> > > optional third argument stating what type of match you wanted. It was
> > > then a trivial patch to add a regex match type. You weren't a huge
> > > fan, though. :)
> > >
> > > http://lists.x.org/archives/xorg-devel/2010-December/016369.html
> > >
> > > I was reworking it so that it accepted programmer names like "strcmp"
> > > in addition to "string", but life has gotten in the way quite a bit. I
> > > still think that would be a useful addition.
> >
> > right, I remember now. my main grief was that it would have been another
> > rather specific syntax instead of the quite common s/foo/bar. i don't have a
> > problem with regex per-se as long as we can get the syntax sorted out.
> >
> BTW, if we adopt two modes: simple and regex, we don't even need an optional
> argument. Consider e.g. a string of the form "|regex|". It is useless in
> the simple mode, hence regex is recognized and two |-s are dropped.
Except in the MatchLayout case, where "|regex|" would actually match
something, isn't it? :)
I believe | is used frequently in regular expressions, so using it as
decision over regex or simple is dangerous. we can't use slash either, there
are likely a few configurations out there already.
My suggestion is simply prefixing with "re:". I guess there's very few
configurations out there that need exactly that match and it makes it very
clear that this match is a regular expression
MatchProduct "re:[^ a-z]{4}|(x|y)"
Cheers,
Peter
(no, I didn't think hard whether this is a valid regex)
More information about the xorg-devel
mailing list