用途
re.search():
>>> import re>>> s1 = "thishasadigit4here">>> m = re.search(r"d", s1)>>> if m is not None:... print("Digit found at position", m.start())... else:... print("No digit in that string")... Digit found at position 13
用途
re.search():
>>> import re>>> s1 = "thishasadigit4here">>> m = re.search(r"d", s1)>>> if m is not None:... print("Digit found at position", m.start())... else:... print("No digit in that string")... Digit found at position 13