Reputation: 949
How can I write a regex pattern that matches the following pattern:
0/2/a/Q
.S/d
.0
s.$
(Dollar sign).I have tried this out, but the two 0
s condition is not satisfied by my code:
import re
data = '''
Hello everyone, good evening, I am kanchon and I am from RUET. Now I am writing my assignment for automata code and trying to solve out this problem.
Some dummy content line is following:
022jdshjgh$dgdg Quite$stupid this is enough
'''
date_pattern = re.compile(r'[02aQ][a-zA-Z0-9$]+[Sd]')
dates = date_pattern.findall(data)
print(dates)
Upvotes: 0
Views: 52