summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/manual.txt39
1 files changed, 10 insertions, 29 deletions
diff --git a/doc/manual.txt b/doc/manual.txt
index 0237b44..cda6f26 100644
--- a/doc/manual.txt
+++ b/doc/manual.txt
@@ -399,11 +399,12 @@ constants in the used library. They are formed as follows:
but for ONIG_OPTION_xxx constants, alias strings are created additionally,
e.g., the value of ONIG_OPTION_IGNORECASE constant becomes accessible via
either of two keys: ``"ONIG_OPTION_IGNORECASE"`` and ``"IGNORECASE"``.
-* **GNU**: the GNU library provides the flags ``not_bol``, which stops
- a beginning-of-line anchor from matching at the start of a string,
- ``not_eol``, which stops an end-of-line anchor from matching at the
- end of a string, and ``reverse`` which causes the search to be
- performed backwards.
+* **GNU**: the GNU library provides the flags ``not_bol``, which stops a
+ beginning-of-line anchor from matching at the start of a string, ``not_eol``,
+ which stops an end-of-line anchor from matching at the end of a string, and
+ ``backward`` which causes the search to be performed backwards, as well as the
+ RE_xxx syntax specifiers (as defined in regex.h), omitting the RE\_ prefix.
+ For example, RE_SYNTAX_GREP becomes ``SYNTAX_GREP`` in Lua.
------------------------------------------------------------
@@ -622,37 +623,17 @@ GNU-only functions and methods
new
---
-:funcdef:`rex.new (patt, [cf], [syn], [tr])`
+:funcdef:`rex.new (patt, [cf], [tr])`
-The *syntax* parameter (*syn*) must be one of the predefined strings that are
-formed from the RE_SYNTAX_xxx identifiers defined in regex.h, by means of
-omitting the RE_SYNTAX\_ part. For example, RE_SYNTAX_GREP becomes ``"GREP"`` on
-the Lua side. The default value, used when the parameter is not supplied or
-``nil``, is either ``"POSIX_EXTENDED"`` (at start-up), or the value set by the
-last setsyntax_ call.
+If the compilation flags (*cf*) are not supplied or ``nil``, the default syntax
+is ``SYNTAX_POSIX_EXTENDED``. Note that this is not the same as passing a value
+of zero, which is the same as ``SYNTAX_EMACS``.
The *translation* parameter (*tr*) is a map of eight-bit character codes (0 to
255 inclusive) to 8-bit characters (strings). If this parameter is given, the
pattern is translated at compilation time, and each string to be matched is
translated when it is being matched.
-setsyntax
----------
-
-:funcdef:`rex_gnu.setsyntax (syntax)`
-
-This function sets the default syntax for the GNU library (see the ``new``
-method above for the interpretation of the *syntax* parameter). The specified
-syntax will be further used for compiling string regex patterns by all relevant
-functions, unless the *syn* argument is passed to those functions explicitly.
-
-**Returns:** nothing
-
-**Examples:**
-
- 1. ``rex_gnu.setsyntax ("POSIX") -- use POSIX regex syntax as the default``
- 2. ``rex_gnu.setsyntax ("EMACS") -- use Emacs regex syntax as the default``
-
Oniguruma-only functions and methods
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~