Use lexical scanning replace charactor scanning