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

Add new rule for detecting some unescaped dots #242

Open
scripthunter7 opened this issue Feb 3, 2025 · 0 comments
Open

Add new rule for detecting some unescaped dots #242

scripthunter7 opened this issue Feb 3, 2025 · 0 comments
Assignees
Labels

Comments

@scripthunter7
Copy link
Member

If an unescaped dot (.) is found in a regex pattern, and it can be reasonably determined that the dot is still part of a valid domain or is followed by a valid TLD, a warning should be displayed, suggesting that the dot should be escaped.

For example, the following rules:

/example.ru\/uploads\/banner\d+.png/
/example.(com|org)/

Should be rewritten as:

/example\.ru\/uploads\/banner\d+.png/
/example\.(com|org)/

This is because an unescaped dot (.) in a regex pattern represents any character, while an escaped dot (\.) explicitly represents a literal dot (.).

Can be autofixed.

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

No branches or pull requests

3 participants