Character Class Range Expander
Expand inclusive bounded ASCII code ranges into a canonical set, merging overlap but rejecting backwards ranges.
Description
Expand inclusive bounded ASCII code ranges into a canonical set, merging overlap but rejecting backwards ranges.
An inclusive character-code range represents every code from its start through its end.
When to use this tool
Expand inclusive bounded ASCII code ranges into a canonical set, merging overlap but rejecting backwards ranges.
- Prepare the supplied ranges 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 ranges. 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.codes. Interpret false, null and empty lists using the distinctions below; they can be valid outputs.
Require each ranges row to have two ordered integer endpoints within 0 to 127. Expand inclusively, deduplicate and sort the combined codes.1
| Input field | Meaning and representation | Accepted input |
|---|---|---|
| ranges | ranges. | Numeric rows; at most 128 rows and 128 values per row |
| Output field | Interpretation |
|---|---|
| result | Object containing the named outputs below. |
| result.codes | The codes list in the ordering and representation described above. |
{
"input": {
"ranges": [
[
1,
3
],
[
3,
4
],
[
7,
7
]
]
},
"output": {
"result": {
"codes": [
1,
2,
3,
4,
7
]
}
}
} Limitations and assumptions
- The domain is ASCII only. It does not evaluate regex class operators, escape syntax or Unicode ranges.
- 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
- Character Class Range Compactor
Compact an explicit ASCII code set into sorted inclusive contiguous ranges, preserving singleton endpoints.
- ASCII Character Class Complement
Complement an explicit code set against ASCII 0–127 only, not Unicode or a regex engine’s complete character universe.