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

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

Re: Why does this happen in regexp isearch?


From: Deniz Dogan
Subject: Re: Why does this happen in regexp isearch?
Date: Sun, 4 Jul 2010 02:40:09 +0200

2010/7/3 Daniel Pittman <daniel@rimspace.net>:
> Deniz Dogan <deniz.a.m.dogan@gmail.com> writes:
>
>> I open cus-edit.el.gz in Emacs and do a regexp isearch for:
>>
>> ^  ;;
>>
>> (Beginning of line, then two spaces, then two semicolons.)
>>
>> For some reason that I don't understand, it seems to match "beginning
>> of line, any number of spaces OR tabs, then two semicolons". When I
>> search for:
>>
>> ^ \{2\};;
>>
>> ...it finds what I'm looking for. Why is this?
>
> (defcustom search-whitespace-regexp (purecopy "\\s-+")
>  "If non-nil, regular expression to match a sequence of whitespace chars.
> This applies to regular expression incremental search.
> When you put a space or spaces in the incremental regexp, it stands for
> this, unless it is inside of a regexp construct such as [...] or *, + or ?.
> You might want to use something like \"[ \\t\\r\\n]+\" instead.
> In the Customization buffer, that is `[' followed by a space,
> a tab, a carriage return (control-M), a newline, and `]+'.
>
> When this is nil, each space you type matches literally, against one space."
>  :type '(choice (const :tag "Find Spaces Literally" nil)
>                 regexp)
>  :group 'isearch)
>

Thank you.

-- 
Deniz Dogan



reply via email to

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