[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Help with regexp

From: Andreas Politz
Subject: Re: Help with regexp
Date: Wed, 02 Dec 2009 09:14:30 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

address@hidden writes:

> On Wed, Dec 02, 2009 at 07:03:02AM +0100, Andreas Politz wrote:
>> address@hidden writes:
> [...]
>> > Wow, Pascal. You have taught this old dog a new trick [...]
> [...]
>> Since this topic is more or less closed (modulo escaped delimiter), we
>> could use it to discuss the question, why using non-trivial Emacs regexp
>> makes one feel like Chomsky had just written his influential book on
>> grammars.
> ;-)
>> Things I (won't) miss most:
>> - extreme backslasheritis
> Meaning: backslasheritis of the First Kind (aka |, (, ), {, } not having
> special meaning) or backslasheritis of the Second Kind (aka having to
> escape backslashes to get them into the string in the first place)?
> Mind you, I don't like it either, but any idea I had kills some aspect
> of Simplicity we all appreciate in Emacs :-(
I am glad there isn't a third kind.  What about the idea of getting rid
of them ?  Some ideas :

- a new family of regexp functions ([+]backwards compatibility)
- a 2nd string syntax w/o escapes ([+]should not need new data-type)
- a flag in the re to signal backslasheritis frailty
  (\v in vim, [-]backwards compatibility)

What kind of simplicity are you referring to ?

>> - no short aliases for important constructs :
>>   digits,symbol-constituents,newline,space
> Well, you always have those pesky [:stuff:] ones. They ain't so tidy,
> but once you get used to them they are even more readable (and they
> reduce the backslash density considerably).

That sounds pretty weak.  I would prefer \d over [[:digit:]] and [0-9] .

>> - no zero-width matches ; look(ahead|behind)
> Hm. To be fair, there are some, among others \b, \B, \<, \> (and the
> funky \=, which matches at point). Yor are looking for a general zero
> width match?

True. No, I was mostly thinking of look ahead/behind kind of context
matching.  To be fair, I already saw a patch on, I believe,
for this.  
> Regards
> -- tomás


reply via email to

[Prev in Thread] Current Thread [Next in Thread]