Skip to content

Instantly share code, notes, and snippets.

@jacius
Created December 24, 2009 07:54
Show Gist options
  • Save jacius/263078 to your computer and use it in GitHub Desktop.
Save jacius/263078 to your computer and use it in GitHub Desktop.
weird regexps
%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