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

Fix code scanning alert no. 9: Useless regular-expression character escape #20

Merged
merged 1 commit into from
Oct 6, 2024

Conversation

akaday
Copy link
Owner

@akaday akaday commented Oct 6, 2024

Fixes https://github.com/akaday/vscode/security/code-scanning/9

To fix the problem, we need to ensure that the regular expression correctly matches a literal dot character. This can be achieved by using double backslashes in the string literal to escape the dot properly. Specifically, we should change \. to \\. in the regular expression string.

  • Update the regular expression on line 12 to use \\. instead of \..
  • This change ensures that the regular expression matches a literal dot character, preserving the intended functionality.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

…scape

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Signed-off-by: aka <akadev8@outlook.com>
@akaday akaday marked this pull request as ready for review October 6, 2024 08:36
@akaday akaday merged commit 18dc5de into main Oct 6, 2024
9 of 16 checks passed
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

Successfully merging this pull request may close these issues.

1 participant