regex documentation?

General discussion on all other topics under the sun.

Moderator: Renato

a2457123
New User
Posts: 4
Joined: Fri Aug 09, 2024 8:28 pm
Are you a spam bot?: No

regex documentation?

Post 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?
mikhailo2608ilaol
Senior User
Posts: 24
Joined: Tue Feb 09, 2021 6:08 pm
Are you a spam bot?: No

Re: regex documentation?

Post by mikhailo2608ilaol »

a2457123
New User
Posts: 4
Joined: Fri Aug 09, 2024 8:28 pm
Are you a spam bot?: No

Re: regex documentation?

Post 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 "."
guangong
Developer
Posts: 658
Joined: Wed Dec 21, 2011 5:58 am
Are you a spam bot?: No

Re: regex documentation?

Post 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

Who is online

Users browsing this forum: Claude [Bot], PetalBot and 0 guests