all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* How do I search for 9001 or 4001
@ 2012-08-22 10:55 acomber
  2012-08-22 11:12 ` acomber
  2012-08-22 11:21 ` Mark Skilbeck
  0 siblings, 2 replies; 8+ messages in thread
From: acomber @ 2012-08-22 10:55 UTC (permalink / raw)
  To: Help-gnu-emacs

I want to do a regex search for the text '4001' or '9001'.  I thought C-M-s
4001|9001 would work but it doesn't.  How do I do this?



--
View this message in context: http://emacs.1067599.n5.nabble.com/How-do-I-search-for-9001-or-4001-tp262065.html
Sent from the Emacs - Help mailing list archive at Nabble.com.



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How do I search for 9001 or 4001
  2012-08-22 10:55 acomber
@ 2012-08-22 11:12 ` acomber
  2012-08-22 11:21 ` Mark Skilbeck
  1 sibling, 0 replies; 8+ messages in thread
From: acomber @ 2012-08-22 11:12 UTC (permalink / raw)
  To: Help-gnu-emacs

Its ok I worked it out, you have to escape the |.

C-M-s 4001\|9001





--
View this message in context: http://emacs.1067599.n5.nabble.com/How-do-I-search-for-9001-or-4001-tp262065p262066.html
Sent from the Emacs - Help mailing list archive at Nabble.com.



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How do I search for 9001 or 4001
  2012-08-22 10:55 acomber
  2012-08-22 11:12 ` acomber
@ 2012-08-22 11:21 ` Mark Skilbeck
  1 sibling, 0 replies; 8+ messages in thread
From: Mark Skilbeck @ 2012-08-22 11:21 UTC (permalink / raw)
  To: acomber; +Cc: Help-gnu-emacs

You will want to precede that operator with a backslash: 4001\|9001.

Read up on the Emacs Regex stuff (RTFM!): http://www.gnu.org/software/emacs/manual/html_node/emacs/Regexps.html

- mgsk

On Wed, Aug 22, 2012 at 03:55:15AM -0700, acomber wrote:
> I want to do a regex search for the text '4001' or '9001'.  I thought C-M-s
> 4001|9001 would work but it doesn't.  How do I do this?
> 
> 
> 
> --
> View this message in context: http://emacs.1067599.n5.nabble.com/How-do-I-search-for-9001-or-4001-tp262065.html
> Sent from the Emacs - Help mailing list archive at Nabble.com.



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How do I search for 9001 or 4001
       [not found] <mailman.7406.1345632926.855.help-gnu-emacs@gnu.org>
@ 2012-08-22 12:34 ` Joost Kremers
  2012-08-22 14:45 ` Barry Margolin
  1 sibling, 0 replies; 8+ messages in thread
From: Joost Kremers @ 2012-08-22 12:34 UTC (permalink / raw)
  To: help-gnu-emacs

acomber wrote:
> I want to do a regex search for the text '4001' or '9001'.  I thought C-M-s
> 4001|9001 would work but it doesn't.  How do I do this?

C-M-s [49]001


-- 
Joost Kremers                                      joostkremers@yahoo.com
Selbst in die Unterwelt dringt durch Spalten Licht
EN:SiS(9)


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How do I search for 9001 or 4001
       [not found] <mailman.7406.1345632926.855.help-gnu-emacs@gnu.org>
  2012-08-22 12:34 ` How do I search for 9001 or 4001 Joost Kremers
@ 2012-08-22 14:45 ` Barry Margolin
  2012-08-22 21:30   ` Joe Fineman
  1 sibling, 1 reply; 8+ messages in thread
From: Barry Margolin @ 2012-08-22 14:45 UTC (permalink / raw)
  To: help-gnu-emacs

In article <mailman.7406.1345632926.855.help-gnu-emacs@gnu.org>,
 acomber <deedexy@gmail.com> wrote:

> I want to do a regex search for the text '4001' or '9001'.  I thought C-M-s
> 4001|9001 would work but it doesn't.  How do I do this?

4001\|9001 will work. Emacs uses basic regular expressions, which means 
that the extended regexp operators have to be escaped. This means you 
have to use \(, \|, and \) instead of (, |, and ).

-- 
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How do I search for 9001 or 4001
  2012-08-22 14:45 ` Barry Margolin
@ 2012-08-22 21:30   ` Joe Fineman
  2012-08-23  2:06     ` Barry Margolin
  0 siblings, 1 reply; 8+ messages in thread
From: Joe Fineman @ 2012-08-22 21:30 UTC (permalink / raw)
  To: help-gnu-emacs

Barry Margolin <barmar@alum.mit.edu> writes:

> 4001\|9001 will work. Emacs uses basic regular expressions, which
> means that the extended regexp operators have to be escaped. This
> means you have to use \(, \|, and \) instead of (, |, and ).

Live & learn.  I never thought of \| as an escaped |.  I thought it
was an approximation to the logicians' $\vee$ for "or".
-- 
---  Joe Fineman    joe_f@verizon.net

||:  I wish I had never been born -- but who has such luck?  Not  :||
||:  one in ten thousand.                                         :||


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How do I search for 9001 or 4001
  2012-08-22 21:30   ` Joe Fineman
@ 2012-08-23  2:06     ` Barry Margolin
  2012-08-23 21:33       ` Joe Fineman
  0 siblings, 1 reply; 8+ messages in thread
From: Barry Margolin @ 2012-08-23  2:06 UTC (permalink / raw)
  To: help-gnu-emacs

In article <ur4qy8vj3.fsf@verizon.net>, Joe Fineman <joe_f@verizon.net> 
wrote:

> Barry Margolin <barmar@alum.mit.edu> writes:
> 
> > 4001\|9001 will work. Emacs uses basic regular expressions, which
> > means that the extended regexp operators have to be escaped. This
> > means you have to use \(, \|, and \) instead of (, |, and ).
> 
> Live & learn.  I never thought of \| as an escaped |.  I thought it
> was an approximation to the logicians' $\vee$ for "or".

Then what are \( and \)?

-- 
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How do I search for 9001 or 4001
  2012-08-23  2:06     ` Barry Margolin
@ 2012-08-23 21:33       ` Joe Fineman
  0 siblings, 0 replies; 8+ messages in thread
From: Joe Fineman @ 2012-08-23 21:33 UTC (permalink / raw)
  To: help-gnu-emacs

Barry Margolin <barmar@alum.mit.edu> writes:

> In article <ur4qy8vj3.fsf@verizon.net>, Joe Fineman <joe_f@verizon.net> 
> wrote:

>> Live & learn.  I never thought of \| as an escaped |.  I thought it
>> was an approximation to the logicians' $\vee$ for "or".
>
> Then what are \( and \)?

Escaped parens, distinct in meaning from literal ones.  I have never
had occasion to include a bare | in a regexp, but would naively expect
it to stand for itself.  Bear in mind that I Am Not a Programmer, and
have never used regexps except in Emacs & Elisp.

I was not expressing any doubt about the proper interpretation as
revealed.
-- 
---  Joe Fineman    joe_f@verizon.net

||:  Money is like muck, no good unless it be spread.  :||


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-08-23 21:33 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.7406.1345632926.855.help-gnu-emacs@gnu.org>
2012-08-22 12:34 ` How do I search for 9001 or 4001 Joost Kremers
2012-08-22 14:45 ` Barry Margolin
2012-08-22 21:30   ` Joe Fineman
2012-08-23  2:06     ` Barry Margolin
2012-08-23 21:33       ` Joe Fineman
2012-08-22 10:55 acomber
2012-08-22 11:12 ` acomber
2012-08-22 11:21 ` Mark Skilbeck

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.