Limited regular expressions
Before we GA regular expressions in C# we'd like to have one consistent regular expression language between C# and Canvas. This PR limits regular expressions to common features that are supported, with consistent semantics, by both canonical .NET (used by the C# interpreter) and XRegExp (used by Canvas/JavaScript). It is better to disallow now and bring back with customer demand or as platforms add more support.
.NET Features that are disallowed:
- Capture groups
- Self-referncing groups, such as
(a\1). - Treat all escaped number sequences as a backreference number.
- Single quoted
(?'name'...and\k'name'. - Balancing capture groups.
- Self-referncing groups, such as
- Octal character codes (use Hex or Unicode instead).
\o(letter o) could be added in the future, but we should avoid\0(zero) which causes backreference confusion.
- Inline options
- Anywhere in the expression except the beginning.
- For subexpressions.
- Character classes
- Character class subtraction
[a-z-[m-n]].
- Character class subtraction
- Conditional alternation
This looks good to me. My top concern is complexity - but this keeps it simple.
Do all positive tests under Match_Limited.txt work in Power Apps?
✅ No public API change.
✅ No public API change.
✅ No public API change.
✅ No public API change.
✅ No public API change.
✅ No public API change.
✅ No public API change.
✅ No public API change.
✅ No public API change.
✅ No public API change.
✅ No public API change.
✅ No public API change.
✅ No public API change.
✅ No public API change.
✅ No public API change.
✅ No public API change.
✅ No public API change.
✅ No public API change.
✅ No public API change.
✅ No public API change.
✅ No public API change.
✅ No public API change.
✅ No public API change.
✅ No public API change.
✅ No public API change.
✅ No public API change.
✅ No public API change.