Created
December 24, 2009 07:54
-
-
Save jacius/263078 to your computer and use it in GitHub Desktop.
weird regexps
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%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. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment