[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Help with regexp
From: |
Stefan Monnier |
Subject: |
Re: Help with regexp |
Date: |
Wed, 02 Dec 2009 22:48:40 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) |
>> > Hi,
>> >
>> > I am trying to find the regexp that could match on these:
>> >
>> > "=>foo"
> [...]
>> "=>\\([^:]*\\(\\|:[^:]*\\(\\|:[^:]*\\)\\)\\)"
> Wow, Pascal. You have taught this old dog a new trick. Up to now, I
> hadn't thought of putting an alternative (i.e. "|") at the start of a
> parenthesized sub-expression. Thanks :-)
An equivalent way is to use ? (or ?? if you care about the order in
which it's matched):
"=>\\([^:]*\\(:[^:]*\\(:[^:]*\\)?\\)?\\)"
Stefan
- Re: Help with regexp, (continued)
- Message not available
- Re: Help with regexp, harven, 2009/12/02
- Re: Help with regexp, Andreas Politz, 2009/12/02
- Re: Help with regexp, Lennart Borgman, 2009/12/02
- Re: Help with regexp, Andreas Politz, 2009/12/02
- Re: Help with regexp, Lennart Borgman, 2009/12/02
- Message not available
- Re: Help with regexp, harven, 2009/12/02
- Re: Help with regexp, Andreas Politz, 2009/12/02
- Message not available
- Re: Help with regexp, Pascal J. Bourguignon, 2009/12/02
Re: Help with regexp, Xavier Maillard, 2009/12/02
Message not available
Message not available
- Re: Help with regexp,
Stefan Monnier <=
Re: Help with regexp, Colin S. Miller, 2009/12/02