(?:+|-)? # Optional leading + or - \d+ # One or more digit (?:\.)? # A trailing . 12. is a number I think (?:\d+)? # The part after the decimal (?:[Ee](?:+|-)?\d+) # E or e followed by an optional + or - and one or more digit