all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Anchoring a RE in a string
@ 2012-06-08 18:48 Doug Lewan
  2012-06-08 19:08 ` Doug Lewan
       [not found] ` <mailman.2452.1339182516.855.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 8+ messages in thread
From: Doug Lewan @ 2012-06-08 18:48 UTC (permalink / raw)
  To: help-gnu-emacs@gnu.org

Currently I'm trying to check the /beginning/ of a multi-line string with a regular expression.
The scenario looks like this:

(string-match "^\\s-+ABCD"
              "qwer\n    zxcv\n    ABCD")
                                            ^ Matches here.

I want it to fail because the beginning doesn't match.
I hadn't expected the anchor (^) to match inside the string.

I can't be the only one to have wanted to do this.
What's the right way.

Thanks.

,Douglas
Douglas Lewan
Shubert Ticketing
(201) 489-8600 ext 224





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

end of thread, other threads:[~2012-06-10 14:34 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-08 18:48 Anchoring a RE in a string Doug Lewan
2012-06-08 19:08 ` Doug Lewan
     [not found] ` <mailman.2452.1339182516.855.help-gnu-emacs@gnu.org>
2012-06-08 19:18   ` jpkotta
2012-06-08 21:06     ` Doug Lewan
2012-06-09 19:28       ` Philipp Haselwarter
     [not found]       ` <mailman.2517.1339270124.855.help-gnu-emacs@gnu.org>
2012-06-10  5:38         ` rusi
2012-06-10  7:06           ` Philipp Haselwarter
2012-06-10 14:34             ` Drew Adams

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.