mardi 1 mars 2016

how to re.compile(multiple Regexpression)

I use python2.7.11 to do this work, for example, I have two expressions,

pattern_movie_name=re.compile(r'<span class="title">(.*?)</span>')
pattern_movie_Englishname=re.compile(r'<span class="title">&nbsp;/&nbsp;(.*?)</span>')

if I would like to add them to one expression, how I can do?

pattern_movie_all=re.compile(r'<span class="title">(.*?)</span>'+r'<span class="title">&nbsp;/&nbsp;(.*?)</span>')

It doesn't work for this!




Aucun commentaire:

Enregistrer un commentaire