-
-
Notifications
You must be signed in to change notification settings - Fork 66
-
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?:
after(anyOf(charIn(`-_ `), exactly('').at.lineStart()))
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions
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.
All reactions
0 replies
-
0.9.0 added:
charIn.from('1', '9')
Beta Was this translation helpful? Give feedback.
All reactions
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment