using regular expression to do string parse