Replies: 2 comments
-
Temporary solution: export function charIn(chars: string | RegExp): Input {
if (chars instanceof RegExp) return createInput(chars.source)
return createInput(`[${chars.replace(/[-\\^\]]/g, '\\$&')}]`)
} const positiveInteger = charIn(/[1-9]/).and(digit.times.any())
const commonSeparator = charIn(/[-_\s.]/)
const boundary = charIn(/[-_\s()\/:]/)
const lookbehind = createInput(`(?<=^|${BOUNDARY})`)
const lookahead = createInput(`(?=${BOUNDARY}|$)`) |
Beta Was this translation helpful? Give feedback.
0 replies
-
0.9.0 added: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
About
\s
charIn('-\\s')
=>[\-\\s]
charIn('-\s')
=>[\-s]
charIn('-${whitespace}')
=>[\-\\s]
How to solve this problem?
/0|[1-9]\d*/
Also, is there a more concise way to write it?:
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions