[Tutor] python regex help
Arun Tomar
tomar.arun at gmail.com
Sun Sep 28 20:19:55 CEST 2008
On Sun, 2008-09-28 at 17:26 +0100, Alan Gauld wrote:
> "Arun Tomar" <tomar.arun at gmail.com> wrote
>
> > I've been using shell scripting & using sed & pipes i've solved it,
> > but with python, i need to practice more ;).
ok, i got it.
here is the code that needs to be included after code in the last mail ;)
sub1 = "(-.*)|(Tel:)|\(M\)|\(R\)"
new_reg = re.compile(sub1)
for n in range(len(new_array)):
mod_array.append(new_reg.sub('',new_array[n]))
cheers,
arun.
More information about the Tutor
mailing list