The goal is to use regex to identify is a sequence of characters and numbers found in the string. The sequence can range in number and size.
examples:
"/eatatjoes/times/33345843"
"/dosomesquats/times/03940993239/nosquats/432"
so far I have the following code:
import re
my_string: str = "/eatatjoes/times/33345843"
result = re.search(r"w/times/d", my_string)
print(result)
the print is as follows
re.Match object; span=(10, 18), match = 's/times/3'
what do I need to do to have it identify the full matched pattern?
tried the different special characters that regex uses for identifying varying entries. looked through multiple examples but all primarily focus on matching exact words, not patterns.
linkey apiacess is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.