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

JavaScript regex matches function name that starts with a digit #62

Closed
farhan443 opened this issue Nov 7, 2021 · 0 comments · Fixed by #63
Closed

JavaScript regex matches function name that starts with a digit #62

farhan443 opened this issue Nov 7, 2021 · 0 comments · Fixed by #63

Comments

@farhan443
Copy link
Contributor

farhan443 commented Nov 7, 2021

In https://github.com/teknologi-umum/flourite/blob/master/src/languages/javascript.ts#L19 :

function\*?(\s+[$\w]+\s*\(.*\)|\s*\(.*\))

This regex can match:

  • function 12()
  • function 1_2_3()
  • function 94_abc(a)

They should not match because function name can't start with a digit.

@farhan443 farhan443 changed the title JavaScript regex matches invalid function name JavaScript regex matches function name that starts with a digit Nov 7, 2021
@farhan443 farhan443 reopened this Nov 8, 2021
aldy505 pushed a commit that referenced this issue Nov 8, 2021
fix #62: minimize incorrect matches for javascript function
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 a pull request may close this issue.

1 participant