buggy GNU-regexp, when using multiline+alternation

  • Thread starter Simon Strandgaard
  • Start date
S

Simon Strandgaard

irb(main):001:0> /(?m)a*.a|b*.b/.match("0bab\nab1").to_a
=> ["0b"]
irb(main):002:0>

I would expect it to output "bab" !
 
S

Simon Strandgaard

Simon Strandgaard said:
irb(main):001:0> /(?m)a*.a|b*.b/.match("0bab\nab1").to_a
=> ["0b"]
irb(main):002:0>

I would expect it to output "bab" !

Silly me I must be tired, I swapped '*.' with '.*'... I take it back, no
problems.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top