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/.