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 bad regex (issue #119) #120

Merged
merged 1 commit into from
Jun 2, 2015
Merged

Fix bad regex (issue #119) #120

merged 1 commit into from
Jun 2, 2015

Conversation

alexandernst
Copy link
Contributor

There are some issues with the regex that this commit fixes:

  • The first one is that [v|V] is already a range, so there is no need for the |.
  • The current regex is actually expecting either v or V in the version, but that is not required, so we make the entire [vV] optional, by wrapping it into a ()?.
  • Because a missing v or V will still match as an empty match (""), we need to exclude the result, so we make the group optional: ?:

There are some issues with the regex that this commit fixes:

* The first one is that `[v|V]` is already a range, so there is no need for the `|`.
* The current regex is actually expecting either `v` or `V` in the version, but that is not required, so we make the entire `[vV]` optional, by wrapping it into a `()?`.
* Because a missing `v` or `V` will still match as an empty match (`""`), we need to exclude the result, so we make the group optional: `?:`
@alexandernst
Copy link
Contributor Author

This is a fix for #119

@francoispluchino francoispluchino merged commit 553ca76 into fxpio:master Jun 2, 2015
@francoispluchino
Copy link
Member

Thanks!

@francoispluchino francoispluchino added this to the 1.0.2 milestone Jul 1, 2016
@francoispluchino francoispluchino modified the milestones: 1.0.2, 1.0 May 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

2 participants