Feature: Line Comments
Home | Features | Improve this section
A Line Comment is a sequence of characters starting with #
and ending with \n
(or the end of the pattern) that is ignored by pattern matching and can be used to document a pattern.
Syntax
NOTE: The following syntax is an example based on some of the supported engines. For specific engine support, see Engines.
#…\n
— The rest of the line starting from#
is removed from the pattern. Only supported when thex
(extended mode) RegExp flag is set.
Engines
Engine | Supported |
---|---|
Perl | ✔ |
PCRE | ✔ |
Boost.Regex | ❌ |
.NET | ✔ |
Oniguruma | ❌ |
Hyperscan | ❌ |
ICU | ✔ |
Glib/GRegex | ✔ |
ECMAScript | ❌ |