>>> import re
>>> re.match(u'^[一二三四五六七]、', u'一、')
If the pattern and the text are stored in variables (for example, they were read from text files),
>>> myregex='^[一二三四五六七]、'
>>> mytext='一、'
How shall I specify myregex
and mytext
to re.match
, in the same way as re.match(u'^[一二三四五六七]、', u'一、')
? Thanks.