[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4. Regex Types

Currently re-builder understands six different forms of input, namely lisp-re, perl, read, rx, sregex, and string syntax. Read syntax and string syntax are both delimited by "s and behave according to their name. With the perl and string syntax there's no need to escape the backslashes and double quotes simplifying the editing somewhat. The other four allow editing of symbolic regular expressions supported by the packages of the same name. (lisp-re is a package by me and its support may go away as it is nearly the same as the sregex package in Emacs)

Note that the sregex, rx and lisp-re syntaxes will only be available in XEmacs if you've installed them yourself.

Editing symbolic expressions is done through a major mode derived from emacs-lisp-mode so you'll get all the good stuff like automatic indentation and font-locking etc.

When editing a symbolic regular expression, only the first expression in the RE Builder buffer is considered, which helps limiting the extent of the expression like the "s do for the text modes. For the sregex syntax the function sregex is applied to the evaluated expression read. So you can use quoted arguments with something like '("findme") or you can construct arguments to your heart's content with a valid ELisp expression. The compiled string form will be copied by reb-copy. If you want to take a glance at the corresponding string you can temporarily change the input syntax using reb-change-syntax (C-c C-i). The current RE syntax is also displayed in the modeline.

Changing the input syntax is transparent (for the obvious exception non-symbolic -> symbolic) so you can change your mind as often as you like.

There is also a shortcut function, reb-toggle-case (C-c C-c), for toggling the case-fold-search variable in the target buffer with an immediate update.

[ << ] [ >> ]           [Top] [Contents] [Index] [ ? ]

This document was generated by XEmacs Webmaster on October, 2 2007 using texi2html