From: 7stud -- Date: 2011-08-14T05:59:34+09:00 Subject: Re: regex position error Whoops. > I need to know the position of a invalid character. str = %Q[gisele !'_"9? bundchen] str.scan(/[^\w' -]/) do |match| md = Regexp.last_match pos = md.begin(0) puts "#{match} : #{pos}" end --output:-- ! : 7 " : 10 ? : 12 -- Posted via http://www.ruby-forum.com/.