* Why does this happen in regexp isearch?
@ 2010-07-03 10:29 Deniz Dogan
2010-07-03 13:14 ` Daniel Pittman
0 siblings, 1 reply; 4+ messages in thread
From: Deniz Dogan @ 2010-07-03 10:29 UTC (permalink / raw)
To: help-gnu-emacs
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?
--
Deniz Dogan
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Why does this happen in regexp isearch?
[not found] <mailman.2.1278153007.17258.help-gnu-emacs@gnu.org>
@ 2010-07-03 11:18 ` Andreas Politz
0 siblings, 0 replies; 4+ messages in thread
From: Andreas Politz @ 2010-07-03 11:18 UTC (permalink / raw)
To: help-gnu-emacs
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?
(setq search-spaces-regexp nil)
, or read it's documentation.
-ap
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Why does this happen in regexp isearch?
2010-07-03 10:29 Why does this happen in regexp isearch? Deniz Dogan
@ 2010-07-03 13:14 ` Daniel Pittman
2010-07-04 0:40 ` Deniz Dogan
0 siblings, 1 reply; 4+ messages in thread
From: Daniel Pittman @ 2010-07-03 13:14 UTC (permalink / raw)
To: help-gnu-emacs
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)
Regards,
Daniel
--
✣ Daniel Pittman ✉ daniel@rimspace.net ☎ +61 401 155 707
♽ made with 100 percent post-consumer electrons
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Why does this happen in regexp isearch?
2010-07-03 13:14 ` Daniel Pittman
@ 2010-07-04 0:40 ` Deniz Dogan
0 siblings, 0 replies; 4+ messages in thread
From: Deniz Dogan @ 2010-07-04 0:40 UTC (permalink / raw)
To: Daniel Pittman; +Cc: help-gnu-emacs
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
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-07-04 0:40 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-03 10:29 Why does this happen in regexp isearch? Deniz Dogan
2010-07-03 13:14 ` Daniel Pittman
2010-07-04 0:40 ` Deniz Dogan
[not found] <mailman.2.1278153007.17258.help-gnu-emacs@gnu.org>
2010-07-03 11:18 ` Andreas Politz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).