-
Notifications
You must be signed in to change notification settings - Fork 7
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
Fix regexp handling #2
Comments
i got interested by this, and looks like you can input any type of regexp new RegExp(`(\\.|@[a-z0-9/-]*)?${val.no}(\\.\\w)?`, 'g'); but there is also side effect here, if you input dot it will means any character |
Easiest solution here might be to get rid of the "instead of" part of the message? "Use foo" rather than "Use foo instead of F00" and trust that the user will be able to find the prohibited string? |
Slightly more robust solution would be to make the entirety of the thing a capture group and output whatever the match is? |
Right now, if
no
strings in the configuration contain regexp-y things, they will happily be processed as a regular expression. I can't decide if this is a feature or a bug.If a feature, then the issue is that the output will contain the regexp-y things, like:
That
\b
is a zero-width word-boundary. Not terribly friendly output. (By the way, the config requires that the backslash be escaped so it will look likeno: 'Node\\b'
.)If a bug, then we should find a way to disable it and enable a more explicit "this is a regexp" way of doing things. Also, make sure the regexp-way-of-doing-things has a decent error message for output.
The text was updated successfully, but these errors were encountered: