emacs-devel
[Top][All Lists]
Advanced

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

Re: Structural regular expressions


From: Lennart Borgman
Subject: Re: Structural regular expressions
Date: Thu, 9 Sep 2010 19:02:44 +0200

On Thu, Sep 9, 2010 at 6:53 PM, Tom <address@hidden> wrote:
> Lennart Borgman <lennart.borgman <at> gmail.com> writes:
>
>> > And what happens then if I want to regexp replace "foo\s-*bar"? It would
>> > still be susceptible to the above mentioned boundary problem, so it's
>> > not a robust workaround.
>>
>> It does not look to me like it would be susceptible to that problem.
>> Maybe I am misunderstanding you. Can you explain more in detail why
>> you think it would be a problem with the solution I suggested? (Please
>> note that I said the parts outside of the multiple narrowing should be
>> treated as "whitespace", not "invisible" or "non-existent".)
>
> Maybe I am misunderstanding you.
>
> As I understood your suggestion:
>
> <.....foo> ... whitespace ... <bar ... >
>
> Since \s- as a regexp matches whitespace the regexp "foo\s-*bar" would match
> the end of the first range and the beginning of the second range separated
> by whitespace.

Ah, I see. Yes, it could be a problem in an example like that.

So if something like my suggestion was implemented then perhaps we
have to distinguish this "whitespace" from other whitespace.

However I think that it would still be useful to let it behave as
whitespace in many situations. I am thinking about parsers in multi
major mode buffers for example.



reply via email to

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