2015年5月17日星期日

Number Validation

We start with trimming.
  • If we see [0-9] we reset the number flags.
  • We can only see . if we didn't see e or ..  E后面不能有小数点
  • We can only see e if we didn't see e but we did see a number. We reset numberAfterE flag.
  • We can only see + and - in the beginning and after an e
  • any other character break the validation.