F
Francis Hwang
Is this behavior a bug, or am I misunderstanding how I should make a
regexp?
irb(main):001:0> str = "123.456.*"
=> "123.456.*"
irb(main):002:0> str =~ /^[0123456789.-*]+/
SyntaxError: compile error
(irb):2: empty range in char class: /^[0123456789.-*]+/
from (irb):2
irb(main):003:0> str =~ /^[0123456789*.-]+/
=> 0
Francis
regexp?
irb(main):001:0> str = "123.456.*"
=> "123.456.*"
irb(main):002:0> str =~ /^[0123456789.-*]+/
SyntaxError: compile error
(irb):2: empty range in char class: /^[0123456789.-*]+/
from (irb):2
irb(main):003:0> str =~ /^[0123456789*.-]+/
=> 0
Francis