Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor regexes with super-expressive #61

Open
carafelix opened this issue Dec 26, 2024 · 0 comments
Open

Refactor regexes with super-expressive #61

carafelix opened this issue Dec 26, 2024 · 0 comments

Comments

@carafelix
Copy link
Member

s.replace(new RegExp(`\\${find}`, "g"), replace);

`(\?\<\!\\S)(\?<prefix>${escapeSpecial(prefix)})\\S+(\\s|$)`,

const NOCASE_COMMAND_NAME_REGEX = /^[0-9a-z_]+$/i;

name.replace(/[0-9a-z_]/ig, "")

`${escapedPrefix}(?<command>[^@ ]+)(?:@(?<username>[^\\s]*))?(?<rest>.*)`,

make sure regex internal type is inferred (like: for regex.username)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant