Regular expressions that work "everywhere"(johndcook.com) |
Regular expressions that work "everywhere"(johndcook.com) |
Here are some of the [more popular][1] ones, and then there are PCRE and Python.
It took me a while to learn that some of the older ones you see in e.g. grep are [specified by POSIX][2].
[1]: https://cppreference.com/cpp/regex#Regular_expression_gramma...
[2]: https://pubs.opengroup.org/onlinepubs/009696899/basedefs/xbd...
These already do not work in many tools which require those special characters to be escaped to have any meaning. An easy example is GNU grep, sed, etc. which use BRE ("Basic Regular Expressions") by default. The article mentions GNU coreutils but does not explain that `-E` is required to fix that behavior.