In Python I can do
import re
re.match("m", "mark")
and I get the expected result:
<_sre.SRE_Match object; span=(0, 1), match='m'>
But it only works if the pattern is at the start of the string:
re.match("m", "amark")
gives None
. There is noting about that pattern which requires it to be at the start of the string - no ^
or similar. Indeed it works as expected on regex101.
Does Python have some special behaviour - and how do I disable it please?