Description 🆒 Character Range Issues
Description
Current
Generated Pattern
Expected Pattern
Number Range
charIn('1-9')
/[1\-9]/
/[1-9]/
Alternatives
charIn('123456789')
/[123456789]/
/[1-9]/
Ideal API
charIn('1-9')
n/a
/[1-9]/
Whitespace Character Class Issues
Description
Current
Generated Pattern
Expected Pattern
Escaped \s in String
charIn('abc\\s')
/[abc\\s]/
/[abc\s]/
Alternatives
charIn('abc').or(whitespace)
/(?:[abc]|\s)/
/[abc\s]/
Ideal API Option 1
charIn('abc\\s')
n/a
/[abc\s]/
Ideal API Option 2
charIn('abc${whitespace}')
n/a
/[abc\s]/
Complex Lookbehind or lookahead Structure Issues
Description
Current
Generated Pattern
Expected Pattern
Lookbehind
exactly('').after(anyOf(exactly('').at.lineStart(), charIn('-_(:'))
/(?<=(?:^|[\-_(:]))/
/(?<=(?:^|[-_(:]))/
Ideal API
after(anyOf(lineStart, charIn('-_(:'))
n/a
/(?<=(?:^|[-_(:]))/
ℹ️ Additional info
Character Range Interpretation :
The library interprets '1-9' literally as the characters "1", "-", and "9" instead of the range from 1 to 9
Proper character ranges need to be enumerated manually
Escaped Character Handling :
Escape sequences like \\s in strings are not correctly translated to regex character classes
The library creates unnecessary alternation when combining regular characters with special classes
Suggested Improvements
Implement proper character range parsing in charIn(): - between two characters should create a range
Support proper escape sequence handling in character classes
Introduce more concise helper functions for common patterns (e.g., lineStart, after)
Reactions are currently unavailable
You can’t perform that action at this time.
🆒 Character Range Issues
charIn('1-9')/[1\-9]//[1-9]/charIn('123456789')/[123456789]//[1-9]/charIn('1-9')/[1-9]/Whitespace Character Class Issues
\sin StringcharIn('abc\\s')/[abc\\s]//[abc\s]/charIn('abc').or(whitespace)/(?:[abc]|\s)//[abc\s]/charIn('abc\\s')/[abc\s]/charIn('abc${whitespace}')/[abc\s]/Complex Lookbehind or lookahead Structure Issues
exactly('').after(anyOf(exactly('').at.lineStart(), charIn('-_(:'))/(?<=(?:^|[\-_(:]))//(?<=(?:^|[-_(:]))/after(anyOf(lineStart, charIn('-_(:'))/(?<=(?:^|[-_(:]))/ℹ️ Additional info
Character Range Interpretation:
'1-9'literally as the characters "1", "-", and "9" instead of the range from 1 to 9Escaped Character Handling:
\\sin strings are not correctly translated to regex character classesSuggested Improvements
charIn():-between two characters should create a rangelineStart,after)