Search
 
SCRIPT & CODE EXAMPLE
 

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)
Comment

PREVIOUS NEXT
Code Example
Python :: how to add find the smallest int n in a list python 
Python :: change group box border color pyqt5 
Python :: python menentukan genap ganjil 
Python :: printed in a comma-separated sequence on a single line. 
Python :: python sort list by rule 
Python :: django table view sort filter 
Python :: filter function in python 
Python :: how to remove whitespace from string in python 
Python :: python random number between 0 and 1 
Python :: def create(self validated_data) 
Python :: 151 - Power Crisis solution in python 
Python :: 2 functions at a time py 
Python :: python sum only numbers 
Python :: from sklearn.metrics import confusion_matrix pred = model.predict(X_test) pred = np.argmax(pred,axis = 1) y_true = np.argmax(y_test,axis = 1) 
Python :: how to set class attributes with kwargs python 
Python :: np.array_equal 
Python :: global /tmp/pip-req-build-civioau0/opencv/modules/videoio/src/cap_v4l.cpp (587) autosetup_capture_mode_v4l2 videoio(v4l2:/dev/video0): device is busy 
Python :: check if binary tree is balanced python 
Python :: python print ling line in print 
Python :: seaborn set figure size 
Python :: python remove everything except numbers from string 
Python :: union type python 
Python :: read csv in spark 
Python :: fonction nombre premier python 
Python :: maximun row and columns in python 
Python :: django pycharm 
Python :: Finding if 2 consecutive numbers in a list have a sum equal to a given number 
Python :: create a date value array in python 
Python :: upload file django 
Python :: function annotation 
ADD CONTENT
Topic
Content
Source link
Name
9+7 =