Page 1 of 1
regex documentation?
Posted: Fri Aug 09, 2024 9:16 pm
by a2457123
In a previous post (
viewtopic.php?p=24735#p24735) about regex filtering, there was the phrase
use standard regex
...
Which regex "standard" is used within MMEX? For example:
- perl
python
BASH
vi
sed
awk
JavaScript
each have similar -- but different -- regular expression syntax.
Short of reading the source code, is there documentation on regular expressions in MMEX?
Re: regex documentation?
Posted: Sat Aug 10, 2024 3:32 pm
by mikhailo2608ilaol
Re: regex documentation?
Posted: Sun Aug 11, 2024 12:08 am
by a2457123
Thanks.
Those are helpful examples, but that's not the same as the syntax definition.
For example, some of the things that are
not present in that github page include:
- documentation of "?" within the regular expressions (does it match any single character...if so, how does that differ in syntax from ".", or is the "?" only used in a sequence of "?!" to negate a match)
- are there other predefined character classes, such as "\s" to match white space, "\S" to match non-whitespace, "\D" to match non-numeric characters
- are regular expressions in MMEX case-sensitive or insensitive, and if case-sensitive, are there operators to make a regular expression insensitive
- are there operators to match a sequence, for example {0..5} or [0-5] to match the numbers 0 through 5 (inclusive)
- is there an operator to anchor the regular expression to the end of the string (typically "$")
- do MMEX regular expressions distinguish between different forms of whitespace (space, tab, newline) within a string
- is there an operator to specify the number of matches, for example a regular expression like \d{4-8}\.\d{2} to match numbers with 4 to 8 digits before the decimal point and exactly 2 digits after
- how can regular expression operators be used a string literals within a regular expression...for example, to match the literal character "."
Re: regex documentation?
Posted: Mon Aug 12, 2024 7:58 am
by guangong
hi
@a2457123 ,
in short, it is built on top of PCRE library (
https://www.pcre.org/).
it would be found here
https://docs.wxwidgets.org/3.2.5/classwx_reg_ex.html