Created
July 16, 2019 19:48
-
-
Save BanzaiMan/a4df24e27e210a0e0db0738c29ac7b25 to your computer and use it in GitHub Desktop.
Why does it *not* work with the last example?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HHVM_VERSION_REGEXP = / | |
(?:hhvm$) | |
|( | |
hhvm-( | |
(?<numeric>\d+(\.\d+)*)(?<lts>-lts)?$ | |
| | |
(?<version> | |
dbg$| | |
dev$| | |
nightly$| | |
nightly-dbg$| | |
dev-nightly$ | |
) | |
) | |
/x | |
vers = %w( | |
hhvm | |
hhvm-nightly | |
hhvm- | |
hhvm-3.25 | |
hhvm-3.25-lts | |
) | |
vers.each do |v| | |
if md = HHVM_VERSION_REGEXP.match(v) | |
puts md.inspect | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment