[Tutor] Regex help please.

lumbricus@gmx.net lumbricus@gmx.net
Wed, 14 Aug 2002 19:50:13 +0200 (MEST)


> >> 
> >> to nit pick the regex, it should be '\.htm'.  A period in a regex means
> >> "any
> >> character".
> > 
> > But Res are overkill anyway for this task.
> > 
> > new_name=old_name[1:]+'l'
> > 
> > should be enough.
> > Untested.
> > 
> 
> no because you have to find the string first (-:

ROTFL *patsch* of course.
But -- Does somebody know:
If these filenames are separated by whitespace,
you could split() the line, test each item for the '?'
(if item[0]=='?') and then replace as above.
Is this faster than using re?
I read sometimes, res are not so performant, when 
aplied to simple patterns and should be avoided if possible.

Greetings, J"o!

-- 


-- 
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net