I can’t figure out what this does:
“1\n2\n3\n”[ /.\Z?/ ]
=> “”
I would expect it to output “1”, just as:
“1\n2\n3\n”[ /.(\Z)?/ ]
=> “1”
Is this a bug?
I can’t figure out what this does:
“1\n2\n3\n”[ /.\Z?/ ]
=> “”
I would expect it to output “1”, just as:
“1\n2\n3\n”[ /.(\Z)?/ ]
=> “1”
Is this a bug?
On Oct 2, 10:11 am, Daniel DeLorme [email protected] wrote:
I can’t figure out what this does:
“1\n2\n3\n”[ /.\Z?/ ]
=> “”I would expect it to output “1”, just as:
“1\n2\n3\n”[ /.(\Z)?/ ]
=> “1”Is this a bug?
Neither one of those make any sense. An optional end-of-string means
nothing. That second one is the same as [/./]
– Mark.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs