Skip to content

Instantly share code, notes, and snippets.

@gabamnml
Created June 19, 2012 05:06
Show Gist options
  • Save gabamnml/2952401 to your computer and use it in GitHub Desktop.
Save gabamnml/2952401 to your computer and use it in GitHub Desktop.
test regular expressions in ruby
st = "\033[7m"
en = "\033[m"
while TRUE
print "str> "
STDOUT.flush
str = gets
break
if not str
str.chop!
print "pat> "
STDOUT.flush
re = gets
break
if not re
re.chop!
str.gsub! re, "#{st}\\&#{en}"
print str, "\n"
end
print "\n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment