Regex Flag Set Audit
Audit syntactic ECMAScript flag names, duplicates and mutually exclusive u/v flags; does not assert every flag is supported by the installed runtime.
Description
Audit syntactic ECMAScript flag names, duplicates and mutually exclusive u/v flags; does not assert every flag is supported by the installed runtime.
Regex flag strings can contain duplicates, unsupported characters or mutually exclusive Unicode modes. These conditions are independently useful to report.
When to use this tool
Audit syntactic ECMAScript flag names, duplicates and mutually exclusive u/v flags; does not assert every flag is supported by the installed runtime.
- Prepare the supplied flags fields for this operation.
- Compare the complete example with the representation used by your own input before carrying the result into another step.
How to use the tool and how it works
- Enter flags. Use the exact text syntax, units and index conventions explained below.
- Run the tool. If input validation fails, correct the supplied fields before interpreting any result.
- Read result.valid, result.duplicates, result.unknown, result.unicodeConflict. Interpret false, null and empty lists using the distinctions below; they can be valid outputs.
Accept the declared flag inventory dgimsuvy, group repeated characters with positions, list unknown characters and flag simultaneous u and v. valid requires none of these issues.1
| Input field | Meaning and representation | Accepted input |
|---|---|---|
| flags | flags. | Text; at most 8,192 UTF-16 code units, subject to the grammar above |
| Output field | Interpretation |
|---|---|
| result | Object containing the named outputs below. |
| result.valid | Flag for valid under the exact condition described above. |
| result.duplicates | The duplicates list in the ordering and representation described above. |
| result.unknown | The unknown list in the ordering and representation described above. |
| result.unicodeConflict | Flag for unicode conflict under the exact condition described above. |
{
"input": {
"flags": "gguvx"
},
"output": {
"result": {
"valid": false,
"duplicates": [
{
"key": "g",
"indexes": [
0,
1
]
}
],
"unknown": [
"x"
],
"unicodeConflict": true
}
}
} Limitations and assumptions
- No pattern is compiled and local engine feature support is not tested. Passing this inventory check is not a regex performance or syntax guarantee.
- All declared input fields are required and unexpected top-level fields are rejected. Numbers must be finite; lists are limited to 128 entries and ordinary text fields to 8,192 UTF-16 code units, with tighter limits where stated.
- JSON text inputs must parse within bounded nesting and size limits. Numeric outputs outside the safe finite range are rejected; large exact integer results use decimal strings. Indexes and half-open spans are zero-based unless a rank is explicitly described as one-based.
Alternative or Complementary methods
Compile generated pattern sources with explicitly chosen flags and test them on bounded representative text. Pattern sources, replacement strings and JSON string spellings require different escaping conventions.
References
Similar or alternative tools
- Regex Capture Index Map
Map ECMAScript capture indexes, names and opening-parenthesis UTF-16 positions after runtime syntax validation; escaped/class parentheses are ignored.
- Literal Full Token Pattern Builder
Build a literal full-string ECMAScript pattern with a strict end assertion, avoiding dollar-anchor final-newline acceptance; assumes no multiline flag.