diff --git a/content/docs/function-list.md b/content/docs/function-list.md index 9ebfbd68..a2fba9fd 100644 --- a/content/docs/function-list.md +++ b/content/docs/function-list.md @@ -31,13 +31,15 @@ There are 3 kinds of parsers: function parser, class parser, and mixed parser. _Notes on regular expressions for parsers_: -Other than the caveats below, the function list regular expressions follow the same syntax spelled out in the docs on [Searching: Regular Expressions](../searching/#regular-expressions): +The function list regular expressions follow the same syntax spelled out in the docs on [Searching: Regular Expressions](../searching/#regular-expressions), with the following exceptions or clarifications: - The parser does not accept **regular expression look behind operations** in the expressions. -- The parser can only search for function names, it will not do **regular expression replacement or modification** (so you cannot add text to the matching names) +- The parser can only search for function names, it will not do **regular expression replacement or modification** (so you cannot add text to the matching names, or remove text from the middle; to remove text from the beginning or the end, use `\K` to reset the match, or use **look ahead operations**) - You _may_ use the `(?x)` modifier to allow additional whitespace and `#`-prefixed comments in your regular expression, as described in the docs on [regex search modifiers](../searching/#search-modifiers) - The parser defaults to `. matches newline` being turned on (the equivalent of `(?s)` inside a regex). If you want `.` to _not_ match newlines, please include `(?-s)` in your FunctionList definition regular expressions. +Because the Function List parser uses a subset of the same regular expression syntax that Notepad++ uses for **Search > Find** regular expressions, you can use Notepad++'s search dialog with **Search Mode** set to **☑ Regular Expression** to experiment with the searches. (If you choose to use some other tool -- like one of the many web-based regex explainers -- to help you debug your expression for your Function List definition, please understand that there are many implementations of regular expressions, and even very similar implementations have subtle differences in behavior. You would need to find a tool that uses the exact same Boost library version that Notepad++ uses to have their results be identical. The [Searching: Regular Expressions](../searching/#regular-expressions) section should always list the version of the Boost library used by the most recent Notepad++.) + ### Function parser The `` node accepts the following attributes and contained elements: diff --git a/content/docs/searching.md b/content/docs/searching.md index 64f03021..2b7b40fb 100644 --- a/content/docs/searching.md +++ b/content/docs/searching.md @@ -428,7 +428,7 @@ In extended mode, these escape sequences (a backslash followed by a single chara ## Regular Expressions -Notepad++ regular expressions ("regex") use the Boost regular expression library v1.80 (as of NPP v8.4.7), which is based on PCRE (Perl Compatible Regular Expression) syntax, only departing from it in very minor ways. Complete documentation on the precise implementation is to be found on the Boost pages for [search syntax](https://www.boost.org/doc/libs/1_80_0/libs/regex/doc/html/boost_regex/syntax/perl_syntax.html) and [replacement syntax](https://www.boost.org/doc/libs/1_80_0/libs/regex/doc/html/boost_regex/format/boost_format_syntax.html) +Notepad++ regular expressions ("regex") use the Boost regular expression library v1.80 (as of NPP v8.4.7), which was originally based on PCRE (Perl Compatible Regular Expression) syntax, only departing from it in very minor ways. Complete documentation on the precise implementation is to be found on the Boost pages for [search syntax](https://www.boost.org/doc/libs/1_80_0/libs/regex/doc/html/boost_regex/syntax/perl_syntax.html) and [replacement syntax](https://www.boost.org/doc/libs/1_80_0/libs/regex/doc/html/boost_regex/format/boost_format_syntax.html). (Some users have misunderstood this paragraph to mean that they can use one of the regex-explainer websites that accepts PCRE and expect anything that works there to also work in Notepad++; this is not accurate. There are many different "PCRE" implimentations, and Boost itself does not claim to be "PCRE", though both Boost and PCRE variants have the same origins in an early version of Perl's regex engine. If your regex-explainer does not claim to use the same Boost engine as Notepad++ uses, there _will_ be differences between the results from your chosen website and the results that Notepad++ gives.) The Notepad++ Community has a [FAQ on other resources for regular expressions](https://notepad-plus-plus.org/community/topic/15765/faq-desk-where-to-find-regex-documentation).