re.split function in python code example
Example 1: python split string regular expression
import re
s_nums = 'one1two22three333four'
print(re.split('\d+', s_nums))
# ['one', 'two', 'three', 'four']
Example 2: re.match() python
import re
pattern = '^a...s$'
test_string = 'abyss'
result = re.match(pattern, test_string)
if result:
print("Search successful.")
else:
print("Search unsuccessful.")
Example 3: re.search variable
if re.search(rf"\b(?=\w){TEXTO}\b(?!\w)", subject, re.IGNORECASE):
...do something