Ruby regexp tests
Ruby
code posted
by
murphy < jacius
created at 28 Dec 10:02
Edit
|
Back
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
%r<this is a valid regexp>e.to_s # That's right. %r(this one is valid, but...() it actually closes right here:)i.inspect # Tricky. %r[this is valid too]x.clone # Correct. %r.and this.i.source # Uh-huh. %r!and this, too\!!.! # So it is. %r|what about this?|n.kind_of? # Yep. %r,oh my %r{goodness}\, can this one possibly be valid?!@$\#%^|\/,xi.dup # You betcha it can. %r%ruby sure allow\%s a lot of peculiar regexps!%ou.options # Indeed it does. %r"it's enough to #{"drive"} a syntax /highlighter/ insane! "mixixixixi.pie # I concur. |
585 Bytes in 2 ms with coderay