updated regex
updated scanner code in ruby