Answers for "how to match regex in python"

1

python regex match words

# credit to Stack Overflow user in source link

import re
re.search(r'bisb', your_string)
Posted by: Guest on May-27-2021
3

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.")
Posted by: Guest on July-17-2020

Python Answers by Framework

Browse Popular Code Answers by Language