Skip to navigation
Example to find in python3 a regular expression
06.07.22
#!/usr/bin/env python import re s='ETA .INV 15/07 TEST OF VADIM H2382596/3 foo bar x' print(s) m = re.search( r'H[0-9]*/[0-9]*', s) """ H = we look for letter H [0-9] = after any number from 0-9 * = repeat the before character(preceding) unlimited / = find character forward slash [0-9] after any number between 0 and 9 * = repeat the before character unlimited """ if(m): print(m) print(dir(m)) print(m.start()) print(m.end()) print(m.group()) else: print('...not found')
https://www.geeksforgeeks.org/regular-expression-python-examples-set-1/
Reply
Anonymous
Information Epoch 1783224511
Think parallel.
Home
Notebook
Contact us