B
Bill Atkins
bill@kaitain ruby $ ruby --version
ruby 1.8.2 (2004-11-06) [x86_64-linux]
bill@kaitain ruby $ cat regex_x_bug.rb
regex = /(.*) # X / Y
[abcde]/x
Running this code snippet yields:
regex_x_bug.rb:1: syntax error
If the / in the comment is changed to a -, the code compiles without
complaint It looks like Ruby is interpreting the / as the end of the
regex.
Bill
ruby 1.8.2 (2004-11-06) [x86_64-linux]
bill@kaitain ruby $ cat regex_x_bug.rb
regex = /(.*) # X / Y
[abcde]/x
Running this code snippet yields:
regex_x_bug.rb:1: syntax error
If the / in the comment is changed to a -, the code compiles without
complaint It looks like Ruby is interpreting the / as the end of the
regex.
Bill