Rulex is a new, portable, regular expression language.
The application described in the current source is rulex, a new, portable, regular expression language.
Here are its key functionalities and characteristics:
Simplified Syntax: Rulex aims to address the complexity of traditional regular expressions by offering a simpler and more intuitive syntax.
Readability: Rulex is designed to be more readable than normal regexes. It allows comments and is not whitespace-sensitive. Text must be enclosed in quotes, which increases the length of expressions but improves readability.
Portability: Rulex is compatible with multiple regex engines, including PCRE, JavaScript, Java, .NET, Python, Ruby, and Rust.
Compilation: The regex flavor must be specified during compilation. This allows rulex to ensure that the produced regex works as intended on the targeted regex engine.
Non-Capturing Groups: Non-capturing groups are the default, which simplifies expressions.
Variables: Rulex allows the use of variables to make expressions more DRY (Don't Repeat Yourself).
Error Detection: Rulex detects syntax errors and provides helpful diagnostics, including suggestions for resolving them. It also identifies features not supported by the targeted regex flavor, and parses backslash escapes, which are not allowed in rulex, and explains what to write instead.
Security: The source advises against compiling or executing untrusted rulex expressions on critical infrastructure, due to potential denial-of-service attacks.
Examples: The source provides examples of rulex expressions and their compiled regex counterparts, demonstrating various features like string matching, repetition, alternation, character classes, unicode, boundaries, groups, lookarounds, backreferences, and ranges.
Add-ons: Rulex is available with add-ons such as Advanced Security and GitHub Copilot.
In summary, rulex is designed to be a more readable, maintainable, and portable alternative to traditional regular expressions, while also offering more powerful features.