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:
Oliver Hamlet
2025-07-29 17:56:31 +01:00
parent 675a4fa0c2
commit efd2d43ae3
+6 -1
View File
@@ -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