I am trying to capture some text in a string shown below
testdir1\testdir1\textfile.vhd
I want to capture the file extension plus the dot and i am using the regex
[.vhd]{4}$
This seems to work on regex101
https://regex101.com/r/TSoIN3/2
but when i actually implement this in python it doesn't
import re
result = re.match(r'[.vhd]{4}$',"testdir1\\testdir1\\textfile.vhd")
print(result)
None
I am assuming that the regex is essentially working but i am calling the python match function wrong???
any help would be appreciated.