sample/regx.rb


DEFINITIONS

This source file includes following functions.


   1  st = "\033[7m"
   2  en = "\033[m"
   3  #st = "<<"
   4  #en = ">>"
   5  
   6  while TRUE
   7    print "str> "
   8    STDOUT.flush
   9    input = gets
  10    break if not input
  11    if input != ""
  12      str = input
  13      str.chop!
  14    end
  15    print "pat> "
  16    STDOUT.flush
  17    re = gets
  18    break if not re
  19    re.chop!
  20    str.gsub! re, "#{st}\\&#{en}"
  21    print str, "\n"
  22  end
  23  print "\n"