I would expect this python script:
import re
path='assign-e398846de42d98b1f79109926d0da510.json'
print(path)
m = re.compile('[a-z0-9]{8,}')
print(m.match(path))
print(re.match('[\w\d]{8,}', path))
to behave similarly (i.e.: to match in the same places) as this perl one:
use strict;
$\ = "\n"; $, = "\t";
my $path='assign-e398846de42d98b1f79109926d0da510.json';
print($path);
print $path =~ /([\w\d]{8,})/;
However the output of the python scrip is:
assign-e398846de42d98b1f79109926d0da510.json
None
None
and perl returns:
assign-e398846de42d98b1f79109926d0da510.json
e398846de42d98b1f79109926d0da510
Why is that? How do I capture the 32 char md5 hash in the path name in python?