help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: regexp question: match anything but not a group?


From: Thorsten Jolitz
Subject: Re: regexp question: match anything but not a group?
Date: Fri, 04 Apr 2014 10:53:23 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Andreas Röhler <andreas.roehler@easy-emacs.de> writes:

> Am 03.04.2014 21:36, schrieb Thorsten Jolitz:
>> Andreas Röhler <andreas.roehler@easy-emacs.de> writes:
>>
>>> Am 01.04.2014 23:30, schrieb Thorsten Jolitz:
>>>>
>>>> Hi List,
>>>>
>>>> how can I write a regexp that acts like e.g.
>>>>
>>>> ,------
>>>> | ".*?"
>>>> `------
>>>>
>>>
>>> BTW looks wrong. .* might much nothing, if non-greedy it remains
>>> nothing (?)
>>
>> But it still seems valid to protect against greedyness?
>>
>
> Coming upon evaluating this, cursor at start of "asdf":
>
> (progn (looking-at ".*")(message (match-string-no-properties 0)))asdf
>
> ==> asdf
>
> (progn (looking-at ".*?")(message (match-string-no-properties 0)))asdf
>
> ==> ""


Yes, it seems you are right ... so this is actually always wrong?
Thanks for the tip ...

-- 
cheers,
Thorsten




reply via email to

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