Skip to content

Instantly share code, notes, and snippets.

@tcshao
Last active December 19, 2015 00:59
Show Gist options
  • Save tcshao/5872284 to your computer and use it in GitHub Desktop.
Save tcshao/5872284 to your computer and use it in GitHub Desktop.
filename = "03hardcore.mp3"
pattern1 = /
\d\d # first two are numbers
.ardcore
\. # a dot
mp\d # mpx file
/x
puts pattern1 =~ filename # this returns 0 (match)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment