mar. 08 juin 2010, 12h10
Gregory Adam
atoutfox.public.association
Re: VBScript.RegExp planté
> J'ai pris un pattern plus simple et qui marche (en ignoreCase)
> \b[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b
et qui ne se plante plus
Il y a aussi \w pour [a-z0-9]
Si tu as des patterns un peu complexes, il y a toujours ma contrib qui peut
aider
http://www.atoutfox.org/articles.asp?ACTION=FCONSULTER&ID=0000000695a la fin
_cliptext = m..p1
obj.Pattern = 'CTRL+V' && pour avoir le pattern
Style
MailAddress ( \b<part1>@<part2>\.<part3>\b)
part1 [A-Z0-9._%-]+
part2 [A-Z0-9.-]+
part3 [A-Z]{2,4}
Mais si tu as Moi@bt.co.uk
part2 sera bt.co
Je me demande si part3 ne devrait etre co.uk
--
Gregory
_
"Thierry N" <none@zenbuyer.com> wrote in message
news:hul3pj$6u$1@news.niouzes.net...
> J'ai pris un pattern plus simple et qui marche (en ignoreCase)
> \b[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b
>
> th
>
> "Gregory Adam" <NoOne@NoWhere.com> a écrit dans le message de
> news:hukplh$2t1n$1@news.niouzes.net...
>>
>> Il y a un bug dans ton pattern original
>>
>> o.pattern =
>>
> "\b(?:[0-9a-zA-Z]+(?:[-.=_+&])*[0-9a-zA-Z]+)*@(?:[-0-9a-zA-Z]+[.])+[a-zA-Z]{
> 2,6}\b"
>>
>> la permiere partie devant le @ est optionel : (.....)*@
>> Donc tu pourrais avoir des trucs comme @zenbuyer.com
>>
>>
>> Tu enleves le * - ca ne se plante plus (mais ce n'est pas normal a mon
> avis)
>>
>> o.pattern =
>>
> "\b(?:[0-9a-zA-Z]+(?:[-.=_+&])*[0-9a-zA-Z]+)@(?:[-0-9a-zA-Z]+[.])+[a-zA-Z]{2
> ,6}\b"
>>
>> --
>> Gregory
>> _
>>
>> "Thierry N" <none@zenbuyer.com> wrote in message
>> news:1723844927297662856.549433none-zenbuyer.com@news.atoutfox.com...
>> > Ça plante avec ou sans ; je les ai mises pour lui éviter du travail sur
>> > les sub-matches.
>> >
>> > Au moins mon pattern a l'air correct ...
>> >
>> > Merci Greg
>> > --
>> > thn
>>
>
>
Permalink : http://www.atoutfox.org/nntp.asp?ID=0000003509