Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

re date python

# re date validate/extract particular dd/mm/yyyy
s= 24-12-2021
l = re.compile("^(?P<date>[0-9]{2})-(?P<month>[0-9]{2})-(?P<year>[0-9]{4})$")
m = re.search(r,s)
if m:
  print(m.group("year"))
else:
  print("pattern not found")
Comment

PREVIOUS NEXT
Code Example
Python :: pytorch check if tensor is on gpu 
Python :: numpy ndarray to matrix 
Python :: python list contains string 
Python :: python region 
Python :: run all python files in a directory in windows 
Python :: how to handle missing values in dataset 
Python :: super in django manager 
Python :: array sort python 
Python :: how to install ffmpeg_streaming in python 
Python :: if statement in python 
Python :: python 3 slice reverse 
Python :: regex to end with python 
Python :: pyspark read from redshift 
Python :: how to plot stacked bar chart from grouped data pandas 
Python :: python math functions 
Python :: ajouter element liste python 
Python :: find highest value in array python 
Python :: python number of lines in file 
Python :: django create view class 
Python :: Aggregate on the entire DataFrame without group 
Python :: join python documentation 
Python :: jupyter notebook cell background color 
Python :: split the column value and take first value in pandas 
Python :: shuffle text lines python 
Python :: python check if key exist in json 
Python :: if key in dictionary python 
Python :: Appending rows to a DataFrame 
Python :: dockerfile to run python script 
Python :: lucky number codechef solution 
Python :: tqdm 2 progress bars 
ADD CONTENT
Topic
Content
Source link
Name
2+4 =