Skip to content

Instantly share code, notes, and snippets.

@BanzaiMan
Created July 16, 2019 19:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BanzaiMan/a4df24e27e210a0e0db0738c29ac7b25 to your computer and use it in GitHub Desktop.
Save BanzaiMan/a4df24e27e210a0e0db0738c29ac7b25 to your computer and use it in GitHub Desktop.
Why does it *not* work with the last example?
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