magic-regexp
magic-regexp copied to clipboard
differentiate lowercase letter, uppercase letter, or combine them
đ Your use case
right now the function letter
is include all the uppercase and lowercase letter, my use case is i only need the lowercase letter, and uppercase letter is prohibited.
đ Alternatives you've considered
No response
âšī¸ Additional info
No response
Maybe we can add letter.lowercase
and letter.uppercase
Thanks for suggestion! đ
Hey đ,
I'm interested in working on this! I'm not too sure how to approach the API design, however.
@didavid61202, are you suggesting that letter
becomes:
const letter: Input<"[a-zA-Z]", never, []> & {
lowercase: Input<"[a-z]", never, []>,
uppercase: Input<"[A-Z]", never, []>,
}
?
Otherwise, we could expand the API to include standalone lowercase
and uppercase
Inputs...
export const whitespace = createInput('\\s')
export const letter = createInput('[a-zA-Z]')
+export const lowercase = createInput('[a-z]')
+export const uppercase = createInput('[A-Z]')
export const tab = createInput('\\t')
I'd like to get it done as part of the Hacktoberfest event, so... as soon as we've settled on an API, I'm raring to get started!
Yes, I think that the first option was what @didavid61202 was suggesting, and makes sense.
Also very happy to include other constructed inputs alongside letter/tab, but lower/upper-case makes sense to access within dot notation.