I am trying to capture List[int] (list of integers which might be seperated by a comma) in a string. However I am not getting the expected result.
>>> txt = '''Automatic face localisation is the prerequisite step of
facial image analysis for many applications such as facial attribute
(e.g. expression [64] and age [38]) and facial identity
recognition [45, 31, 55, 11]. A narrow definition of face localisation
may refer to traditional face detection [53, 62], '''
output
>>> re.findall(r'[(\b\d{1,3}\b,)+]',txt)
['(', '6', '4', '3', '8', ')', '4', '5', ',', '3', '1', ',', '5', '5', ',', '1', '1', '5', '3', ',', '6', '2', ',']
What should be the expression to capture the below output.
Expected output:
['[64]', '[38]', '[45, 31, 55, 11]', '[53, 62]']
