Files

8 lines
181 B
Python

import re
# Test the regex pattern
p = re.compile(r'(?:#|//)\s*TODO[:\s]*(.*?)(?:\n|$)')
m = p.search('# TODO: test')
print(f"Match: {m}")
if m:
print(f"Group 1: {m.group(1)}")