Skip to content

Instantly share code, notes, and snippets.

@RadicalZephyr
Last active December 22, 2015 16:59
Show Gist options
  • Save RadicalZephyr/6502948 to your computer and use it in GitHub Desktop.
Save RadicalZephyr/6502948 to your computer and use it in GitHub Desktop.
Show case a macruby bug with regex syntax
puts %r{hello}.match("hello")
brokenreg = %r{
hello #stuff happens
$ # end of line
}x
definition = %r{
^ # begin of line
[ ]{0,3} # up to 3 spaces
: # colon
\s* # whitespace
(\S.*) # the text = $1
$ # end of line
}
definition = %r{
^ # begin of line
[ ]{0,3} # up to 3 spaces
: # colon
\s* # whitespace
(\S.*) # the text = $1
$ # end of line
}x
puts "Hello, MacRuby!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment