i'm struggling to debug my python code with regex in PyCharm.
The idea: I want to find any case of 'here we are', which can go with or without 'attention', and the word 'attention' can be separated by whitespace, dot, comma, exclamation mark.
I expect this expression should do the job
r'(attention.{0,2})?here we are'
Online services like https://regex101.com/ and https://pythex.org/ confirm my expression is correct – and i'm getting expected "attention! here we are"
However, if i run the below code in PyCharm I'm getting such (unexpected for me) result.
my_string_1 = 'attention! here we are!'
my_list = re.findall(r'(attention.{0,2})?here we are', my_string_1)
print(my_list)
>>> ['attention! ']
Could someone direct me to the reason why PyCharm's outcome is different? Thanks