R
ryniek90
Hi.
I started learning regexp, and some things goes well, but most of them
still not.
I've got problem with some regexp. Better post code here:
"
com\n'
(e-mail address removed)
name1 [at] mail [dot] com
name2 [$at$] mail [$dot$] com
(e-mail address removed)
name1 [at] mail [dot] com
name2 [$at$] mail [$dot$] com
"
How must i write that replace pattern (look at question mark), to maek
that substituion work? I didn't saw anything helpful while reading Re
doc and HowTo (from Python Doc). I tried with 'MatchObject.group()' but
something gone wrong - didn't wrote it right.
Is there more user friendly HowTo for Python Re, than this?
I'm new to programming an regexp, sorry for inconvenience.
I started learning regexp, and some things goes well, but most of them
still not.
I've got problem with some regexp. Better post code here:
"
'\[email protected]\nname1 [at] mail [dot] com\nname2 [$at$] mail [$dot$]>>> import re
>>> mail = '\[email protected]\nname1 [at] mail [dot] com\nname2 [$at$] mail [$dot$] com\n'
com\n'
(e-mail address removed)
name1 [at] mail [dot] com
name2 [$at$] mail [$dot$] com
(e-mail address removed)
name1 [at] mail [dot] com
name2 [$at$] mail [$dot$] com
*?*, mail)(e-mail address removed)
name1[at]mail[dot]com
name2[$at$]mail[$dot$]com(e-mail address removed)>>> maail = re.sub('\[at\]|\[\$at\$\]', '@', maail)
>>> print maail
name1@mail[dot]com
name2@mail[$dot$]com(e-mail address removed)>>> maail = re.sub('\[dot\]|\[\$dot\$\]', '.', maail)
>>> print maail
(e-mail address removed)
(e-mail address removed)>>> #How must i write the replace string to replace all this regexp's with just ONE command, in string 'mail' ?
>>> maail = re.sub('^\n|$\n| |\[at\]|\[\$at\$\]|\[dot\]|\[\$dot\$\]',
"
How must i write that replace pattern (look at question mark), to maek
that substituion work? I didn't saw anything helpful while reading Re
doc and HowTo (from Python Doc). I tried with 'MatchObject.group()' but
something gone wrong - didn't wrote it right.
Is there more user friendly HowTo for Python Re, than this?
I'm new to programming an regexp, sorry for inconvenience.