ke, 2007-01-10 kello 10:30 +0100, Nicolas François kirjoitti:
> On Wed, Jan 10, 2007 at 10:45:08AM +0200, [EMAIL PROTECTED] wrote:
> > -=| Nicolas François, 9.01.2007 21:50 |=-
> > > On Tue, Jan 09, 2007 at 05:55:48PM +0200, [EMAIL PROTECTED] wrote:
> > >> # "[EMAIL PROTECTED]" -> "ll_CC.UTF-8"
> > >> s/^([a-z]+)_([A-Z]+)(?:\.([EMAIL PROTECTED])?(?:@euro)?$/$1_$2.UTF-8/;
> > >>
> > >> # "[EMAIL PROTECTED]" -> "[EMAIL PROTECTED]"
> > >> s/^([a-z]+)_([A-Z]+)(?:\.([EMAIL PROTECTED])?@(.+)$/[EMAIL PROTECTED]/;
> > >
> > > And here is the patch for utf8migrationtool.
> > >
> > > match = sre.match("^(.*?)(\..*)?(@.*)?$", w['Login'].currentLocale)
> >
> > If this was perl regex, only first group will ever match, since perl
> > regex modifier "*" is "greedy", i.e. it matches as long as possible
> > before giving up. Not sure how python handles this, but I thought I
> > better mention it.
> >
> > Also, what is the exact meaning of the first "?" ? "*" already matches
> > "0 or more" times...
>
> Eheh;) '*?' indicate a non greedy match. IMO it's the same in perl.
>
> But the second group should also be non greedy (it's not important
> according to the currently SUPPORTED locales, but should be safer).
>
> Martin, can you change the regex to:
> "^(.*?)(\..*?)?(@.*)?$"
>
> or, if you want to avoid the greedy/non greedy issue:
> "^([EMAIL PROTECTED])([EMAIL PROTECTED])?(@.*)?$"
I'm not sure I understand what the issue is about. Wildcard overload.
--
Martin-Éric Racine
http://q-funk.iki.fi