@@ -33,9 +33,29 @@ thus easily become a built-in parser. See ":ref:`optlib2c`" for details.
33
33
Regular expression (regex) engine
34
34
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
35
35
36
- Universal Ctags currently uses the same regex engine as Exuberant Ctags:
37
- the POSIX.2 regex engine in GNU glibc-2.10.1. By default it uses the Extended
38
- Regular Expressions (ERE) syntax, as used by most engines today; however it does
36
+ Universal Ctags currently uses `the POSIX.1 Extended Regular Expressions (ERE)
37
+ <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap09.html> `_
38
+ syntax as same as Exuberant Ctags.
39
+
40
+ During building Universal Ctags the ``configure `` script runs compatibility
41
+ tests of the regex engine in the system library. If tests pass the engine is
42
+ used, otherwise the regex engine imported from `the GNU Gnulib library
43
+ <https://www.gnu.org/software/gnulib/manual/gnulib.html#Regular-expressions> `_
44
+ is used. In the latter case, ``ctags --list-features `` will contain
45
+ ``gnulib_regex ``.
46
+
47
+ See ``regex(7) `` or `the GNU Gnulib Manual
48
+ <https://www.gnu.org/software/gnulib/manual/gnulib.html#Regular-expressions> `_
49
+ for the details of the regular expression syntax.
50
+
51
+ .. note ::
52
+
53
+ The GNU regex engine supports some GNU extensions described `here
54
+ <https://www.gnu.org/software/gnulib/manual/gnulib.html#posix_002dextended-regular-expression-syntax> `_.
55
+ Note that an optlib parser using the extensions may not work with Universal
56
+ Ctags on some other systems.
57
+
58
+ The POSIX.1 Extended Regular Expressions (ERE) does
39
59
*not * support many of the "modern" extensions such as lazy captures,
40
60
non-capturing grouping, atomic grouping, possessive quantifiers, look-ahead/behind,
41
61
etc. It is also notoriously slow when backtracking, and has some known "quirks"
0 commit comments