I am trying to regex match strings change://problem/59689726
and change://1234567
but below code only matches the former,how do I change the regex to match both?how to make problem/
optional?
INPUT CODE:
import re
out = '''
<change://problem/59689726> This is a test1
change://1234567 This is a test2
[Problem]
This is problem desription
'''
m = re.findall("[\S]*(?:change:\/\/problem\/(\d{8,8}))", out.split('[Problem]')[0])
if m:
for radar in set(m):
print radar
CURRENT OUTPUT:-
59689726
EXPECTED OUTPUT:-
59689726 1234567