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

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

Re: Regexp to match any character, including newline?


From: Martin Stone Davis
Subject: Re: Regexp to match any character, including newline?
Date: Sun, 05 Oct 2003 00:09:09 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5) Gecko/20030925

Jesper Harder wrote:

Also, look at the very cool 'rx' package, which provides a much nicer
syntax for regexps than the usual line noise.  For instance:

(rx (and "(" (* anything) "and" (* anything)
         (in "1-2") (repeat 4 digit) (* anything) ")"))
=>
"\\(?:(\\(?:.\\|
\\)*and\\(?:.\\|
\\)*[1-2][[:digit:]]\\{4\\}\\(?:.\\|
\\)*)\\)"

omfg that is the best!

Is this documented anywhere?  I was able to find out about it by typing

M-x apr <RET> rx <RET>

but it is not anywhere in the Elisp info files. I'm sure there are other gems like it in emacs, so how should I go about finding them?

-Martin






reply via email to

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