Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to allow a range of numbers for example 1 to 14 on regular expression python

#if you wanted to allow numbers from 1 to 12
import re
input = input("type a number")
matches = re.search("^([1-9]|1[0-2])$",input)
 
PREVIOUS NEXT
Tagged: #range #numbers #regular #expression #python
ADD COMMENT
Topic
Name
5+2 =