From: Andreas Politz <politza@fh-trier.de>
To: help-gnu-emacs@gnu.org
Subject: Re: Help with regexp
Date: Wed, 02 Dec 2009 09:14:30 +0100 [thread overview]
Message-ID: <87ljhln66x.fsf@fh-trier.de> (raw)
In-Reply-To: 20091202071139.GA6313@tomas
tomas@tuxteam.de writes:
> On Wed, Dec 02, 2009 at 07:03:02AM +0100, Andreas Politz wrote:
>> tomas@tuxteam.de 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 emacs.dev, I believe,
for this.
>
> Regards
> -- tomás
-ap
next prev parent reply other threads:[~2009-12-02 8:14 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <mailman.11978.1259698881.2239.help-gnu-emacs@gnu.org>
2009-12-01 21:07 ` Help with regexp Pascal J. Bourguignon
2009-12-02 5:16 ` tomas
2009-12-02 6:03 ` Andreas Politz
2009-12-02 7:11 ` tomas
2009-12-02 8:14 ` Andreas Politz [this message]
2009-12-05 6:46 ` tomas
2009-12-02 7:18 ` suvayu ali
[not found] ` <mailman.12000.1259733814.2239.help-gnu-emacs@gnu.org>
2009-12-02 9:41 ` harven
2009-12-02 13:31 ` Andreas Politz
2009-12-02 16:05 ` Lennart Borgman
2009-12-02 16:56 ` Andreas Politz
2009-12-02 17:16 ` Lennart Borgman
[not found] ` <mailman.12039.1259774199.2239.help-gnu-emacs@gnu.org>
2009-12-02 20:00 ` harven
2009-12-02 17:01 ` Andreas Politz
[not found] ` <mailman.12029.1259760724.2239.help-gnu-emacs@gnu.org>
2009-12-02 14:16 ` Pascal J. Bourguignon
2009-12-02 6:36 ` Xavier Maillard
[not found] ` <mailman.12002.1259735748.2239.help-gnu-emacs@gnu.org>
2009-12-02 11:16 ` Pascal J. Bourguignon
[not found] ` <mailman.11999.1259731365.2239.help-gnu-emacs@gnu.org>
2009-12-03 3:48 ` Stefan Monnier
2009-12-02 15:37 ` Colin S. Miller
2009-12-01 20:21 Xavier Maillard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87ljhln66x.fsf@fh-trier.de \
--to=politza@fh-trier.de \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).