From: William James Date: 2009-02-10T17:19:04+09:00 Subject: Re: regexp problem Joao Silva wrote: > how i can extract: > > Traffic left: align=right> MB > > i need this nuber: 123313? I tried to match this in many ways but i > stil have problem with escape characters. list = DATA.read.scan( %r{\s*(.*?)\s*}im ).flatten list.each_cons(2){|a,b| if "Traffic left:" == a and b =~ /Math.ceil\((-?\d+)/ p $1 end } __END__ NOT TRAFFIC LEFT: MB Traffic left: MB