If so, what must I do to make the script below work?
% cat regtest.py
import sys, regex
# This should match e.g. xxx___xxx:
pat = regex.compile('\(xxx\)\(.*\)\1')
if pat.search(sys.argv[1]) != -1:
print pat.group(1), pat.group(2)
else:
print 'No match?'
% python regtest.py 'xxx___xxx'
No match?
Mats Svensson