Skip to content

Instantly share code, notes, and snippets.

@rickhull
Last active December 18, 2015 15:09
Show Gist options
  • Save rickhull/5802332 to your computer and use it in GitHub Desktop.
Save rickhull/5802332 to your computer and use it in GitHub Desktop.
[1] pry(main)> rgx = %r{
[1] pry(main)* . # match any char; this comment contains an end brace }
=> /
. # match any char; this comment contains an end brace /
[2] pry(main)> }x
SyntaxError: unexpected '}', expecting $end
# syntax error on extended regex when delimiter is present in comments
rgx = /
. # match any char; this comment contains a slash /
/x
# syntax error before we reach here
'foo'.match rgx # expected #<MatchData "f">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment