Created
June 19, 2012 05:06
-
-
Save gabamnml/2952401 to your computer and use it in GitHub Desktop.
test regular expressions in ruby
This file contains hidden or 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
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