Hey, how do you make a regular expression visible?

I’ve got all these strings in this object holding regular expressions,
and I want to report on them accurately, but all my backslashes are
disappearing. Any suggestions?

Xeno C. wrote:

I’ve got all these strings in this object holding regular expressions,
and I want to report on them accurately, but all my backslashes are
disappearing. Any suggestions?

What does “report on them accurately” entail?

r = /s.d/
p r

–output:–
/s.d/

7stud – wrote:

–output:–
/s.d/
Sorry. My bug. I should have looked closer at my code. Thanks.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs