I know similar questions like this have already been asked on the platform but I checked them and did not find the help I needed.
I have some String such as :
path = "most popular data structure in OOP lists/5438_133195_9917949_1218833? povid=racking these benchmarks"
path = "activewear/2356_15890_9397775? povid=ApparelNavpopular data structure you to be informed when a regression"
I have a function :
def extract_id(path):
pattern = re.compile(r"([0-9]+(_[0-9]+)+)", re.IGNORECASE)
return pattern.match(path)
The expected results are 5438_133195_9917949_1218833 and 2356_15890_9397775. I tested the function online, and it seems to produce the expected result but my it's returning None in my app. What am I doing wrong? Thanks.