D
Dan Kohn
p /#$/.match("#")[0] # syntax error: unterminated string meets eof
The interpreter seems to interpret the first # as a comment but not the
second.
p /\#$/.match("#")[0] # this works
This seems even odder:
p /[#$]/.match("#")[0] # syntax error: compile error
p /[#\$]/.match("#")[0] # we can escape the $ rather than the #
Shouldn't the interpreter ignore # within a Regexp /.../ unless there's
an x flag, a #{...} substitution, or a (?#...) comment? Bug or feature?
The interpreter seems to interpret the first # as a comment but not the
second.
p /\#$/.match("#")[0] # this works
This seems even odder:
p /[#$]/.match("#")[0] # syntax error: compile error
p /[#\$]/.match("#")[0] # we can escape the $ rather than the #
Shouldn't the interpreter ignore # within a Regexp /.../ unless there's
an x flag, a #{...} substitution, or a (?#...) comment? Bug or feature?