We can split the Valid Number String into 5 parts:

Part 1: The \s*, 0 or mang blank spaces.

Part 2: A integer number with '+', '' or nothing.

Part 3: A point '.' with numbers.

Part 4: 'e' with numbers with '+', '' or nothing, Used in scientific notation.

Part 5: The \s*, 0 or mang blank spaces.
and, Part 2 and Part 3 can't be empty simultaneously.
So, We got the regular expression:
reg = "\s*[+,]?(([09]+(.[09])?)([09](.[09]+){1}))(e[+,]?[09]+)?\s*"
and our code:
import re
class Solution(object):
def isNumber(self, s):
"""
:type s: str
:rtype: bool
"""
reg = "\s*[+,]?(([09]+(\.[09]*)?)([09]*(\.[09]+){1}))(e[+,]?[09]+)?\s*"
m = re.match(reg, s)
if m :
return len(m.group()) == len(s)
else :
return False