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: cleanup regex #1

Closed
wants to merge 1 commit into from
Closed

fix: cleanup regex #1

wants to merge 1 commit into from

Conversation

privatenumber
Copy link
Owner

@privatenumber privatenumber commented Aug 3, 2022

Problem

  • The regular expression was not bound to the start and end of the string, and therefore could match a subset
  • The regular expression had many unnecessary capture groups and syntax ({0,1} instead of ?) ((\/|:) instead of [\:])
  • .git should be escaped: \.git

Changes

Improved regular expression syntax by:

  • Adding start and end bounds so that it matches the full string
  • Removed unnecessary capture groups
  • Escaped .

@IonicaBizau the base branch is within my fork but would like to get this in upstream

@benjdlambert
Copy link

@privatenumber can you raise this PR with the upstream library? 🙏

@privatenumber
Copy link
Owner Author

It's already open: IonicaBizau#59

@benjdlambert
Copy link

Apologies - sorry got super confused 👍

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