[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Help with regexp
From: |
harven |
Subject: |
Re: Help with regexp |
Date: |
Wed, 02 Dec 2009 21:00:04 +0100 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.1 (darwin) |
Lennart Borgman <lennart.borgman@gmail.com> writes:
> On Wed, Dec 2, 2009 at 5:56 PM, Andreas Politz <politza@fh-trier.de> wrote:
>>
>> This reminds me of something else regexp related, though fixable.
>> Navigating point inside a regexp is very painfully.
>
> How does it hurt?
That way (quoting the emacs wiki, ParenthesisMatching).
"...It should be noted that the syntax-table makes all delimiters even.
That means that a beginning parenthesis ( may match a closing bracket ]
if the delimiters are not balanced as a whole.
Try C-M-f on the following expression:
( [ ) ]
Here is a short piece of Lisp code in which such a situation occurs:
(while
(re-search-forward "\\(\\[[0-9]\\),\\([0-9]\\]\\)" nil t)
(replace-match (concat (match-string 1) "." (match-string 2))))
This code replaces, e.g. [4,5] by [4.5]. Now, in the regular expression
between quotes " ", the first opening bracket [ matches the
first closing parenthesis ), whereas the last opening parenthesis (
matches the last closing bracket ]..."
- Re: Help with regexp, (continued)
- Re: Help with regexp, suvayu ali, 2009/12/02
- 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 <=
- 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, Colin S. Miller, 2009/12/02