all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Is it valid to use the zero-byte "^@" in regexps?
@ 2014-06-18  9:14 Thorsten Jolitz
  2014-06-18  9:52 ` Nicolas Richard
  2014-06-18 11:38 ` Michael Albinus
  0 siblings, 2 replies; 7+ messages in thread
From: Thorsten Jolitz @ 2014-06-18  9:14 UTC (permalink / raw)
  To: help-gnu-emacs


Hi List, 

when matching multi-line text, using the negated zero-byte in a regexp
is convenient to match *any* chararcter, since it should only appear in
binary files not in text files. 

However, I sometimes get strange and a bit unpredictable results using
this technique. 

To rule out a fundamental problem - is it valid to have the zero-byte
(inserted with C-q C-@) appear in a regexp like this? 

,--------------------------------------------------------
| "^#\\+begin_src[[:space:]]+emacs-lisp[^^@]*\n#\\+end_src"
`--------------------------------------------------------

If so, this regexp should reliably match any 

,-----------------------
| #+begin_src emacs-lisp
|  [...]
| #+end_src
`-----------------------

no matter whats inside the block, right?

-- 
cheers,
Thorsten





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

end of thread, other threads:[~2014-06-18 12:15 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-18  9:14 Is it valid to use the zero-byte "^@" in regexps? Thorsten Jolitz
2014-06-18  9:52 ` Nicolas Richard
2014-06-18 10:22   ` Thorsten Jolitz
2014-06-18 10:55     ` Nicolas Richard
2014-06-18 11:16       ` Thorsten Jolitz
2014-06-18 11:38 ` Michael Albinus
2014-06-18 12:15   ` Nicolas Richard

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.