import re

x="a$"
r="aaa abc aaaa cya"
matcher=re.finditer(x,r)
for match in matcher:
    print(match.start())
    print(match.group())

8f07548aa22723fa726dd368bb36d9ede6dc7ef0
<mask token>

<mask token>
for match in matcher:
    print(match.start())
    print(match.group())

<mask token>
x = 'a$'
r = 'aaa abc aaaa cya'
matcher = re.finditer(x, r)
for match in matcher:
    print(match.start())
    print(match.group())

import re
x = 'a$'
r = 'aaa abc aaaa cya'
matcher = re.finditer(x, r)
for match in matcher:
    print(match.start())
    print(match.group())

import re

x="a$"
r="aaa abc aaaa cya"
matcher=re.finditer(x,r)
for match in matcher:
    print(match.start())
    print(match.group())
