File: rx.el.html
This facility allows writing regexps in a sexp-based language
instead of strings. Regexps in the rx notation are easier to
read, write and maintain; they can be indented and commented in a
natural way, and are easily composed by program code.
The translation to string regexp is done by a macro and does not
incur any extra processing during run time. Example:
(rx bos (or (not (any "^"))
(seq "^" (or " *" "["))))
=> "\\\\`\\\\(?:[^^]\\\\|\\\\^\\\\(?: \\\\*\\\\|\\\\[\\\\)\\\\)"
The notation is much influenced by and retains some compatibility with Olin Shivers's SRE, with concessions to Emacs regexp peculiarities, and the older Emacs package Sregex.
Defined variables (7)
rx--builtin-forms | List of built-in rx function-like symbols. |
rx--builtin-names | List of built-in rx names. These cannot be redefined by the user. |
rx--builtin-symbols | List of built-in rx variable-like symbols. |
rx--char-classes | Alist mapping rx symbols to character classes. |
rx--delayed-evaluation | Whether to allow certain forms to be evaluated at runtime. |
rx--local-definitions | Alist of dynamic local rx definitions. |
rx-constituents | Alist of old-style rx extensions, for compatibility. |