A
Aisha Fenton
Hi,
I can't see why the following Regex isn't working as expected. Maybe a
bug in ruby?
puts "345HI".match(/HI|BYE/).inspect
What I expected was the second regex to find "HI" in the string too. Why
I need this, is that I'm printing data to stdout that will contain some
binary characters, and I'm using a regex to escape the newline
characters that it maybe contains.
I'm using Ruby 1.8.7
Thanks,
Aish
I can't see why the following Regex isn't working as expected. Maybe a
bug in ruby?
puts "345HI".match(/HI|BYE/).inspect
puts "\345HI".match(/HI|BYE/).inspect
What I expected was the second regex to find "HI" in the string too. Why
I need this, is that I'm printing data to stdout that will contain some
binary characters, and I'm using a regex to escape the newline
characters that it maybe contains.
I'm using Ruby 1.8.7
Thanks,
Aish