python3 >>> ls=['11-23-23-44','11-23-23-44x'] >>> import re >>> def chk(s): return not re.search(r'[^-\d]',s) >>> [chk(s)for s in ls] [True, False]
python3