mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
Update plugin name regex doc
fancy-regex supports more syntax than C++ std::regex, but for the syntax that they both accept: - std::regex matches . against a single character, fancy-regex matches it against a Unicode codepoint - \w \W \d \D \s \S \b and \B are locale-dependent in std::regex but Unicode-aware and locale-independent in fancy-regex - case-insensitive comparisons are locale-dependent in std::regex but are Unicode-aware and locale-independent in fancy-regex - std::regex supports \0 and \cX escapes, where X is in [A-Za-z] but fancy-regex does not. This is not significant for libloot's usage as nul and control characters are not allowed in Windows filenames. - std::regex treats \< and \> as < and > respectively, but fancy-regex treats them as start- and end-of-word boundary assertions respectively. This is not significant for libloot's usage as they are not allowed in Windows filenames. - std::regex allows a literal [ to appear within a character class, but fancy-regex requires it to be escaped. These differences are unlikely to cause any issues.
This commit is contained in:
@@ -9,7 +9,12 @@ This is the structure that brings all the others together, and forms the main co
|
||||
|
||||
**Required.** Can be an exact plugin filename or a regular expression plugin filename. If the filename contains any of the characters ``:\*?|``, the string will be treated as a regular expression, otherwise it will be treated as an exact filename. For example, ``Example\.esm`` will be treated as a regular expression, as it contains a ``\`` character.
|
||||
|
||||
Regular expression plugin filenames must be written in `modified ECMAScript <https://en.cppreference.com/w/cpp/regex/ecmascript>`_ syntax.
|
||||
Regular expression plugin filenames must be written in a modified `ECMAScript <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Regular_expressions>`_ syntax. Notable differences include:
|
||||
|
||||
- The ``\q{}`` `character class wrapper <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Regular_expressions/Character_class>`_ is not supported.
|
||||
- Most `v-mode character class escapes <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Regular_expressions/Character_class#v-mode_character_class>`_ are unnecessary: only ``[``, ``&&``, ``--`` and ``~~`` need to be escaped.
|
||||
|
||||
Regular expression plugin filenames are prefixed with ``^`` and suffixed with ``$`` to ensure they match whole filenames, and are case-insensitive and Unicode-aware (as if they're created with the ``i`` and ``v`` flags).
|
||||
|
||||
.. describe:: group
|
||||
|
||||
|
||||
Reference in New Issue
Block a user