Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Parsing a string
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01158677
Message ID:
01158823
Vues:
24
>If you download Craig Boyd's RegExp.FLL, you can do it in fewer lines. :-)
>
>
SET LIBRARY TO HOME(1)+"regexp" ADDITIVE
>
>lcX = "a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,0,1,2,3,4,5,6,7,8,9,10"
>? lcX
>? regexp(lcx, "(.*?,.*?,.*?,.*?,.*?,.*?),", 1, "\1,\n")
It can also be done with WSH
lcX = "a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,0,1,2,3,4,5,6,7,8,9,10"
oRx = CreateObject('VBScript.Regexp')
oRx.Global = .T.
oRx.Pattern = "(.*?,.*?,.*?,.*?,.*?,.*?,)"
? oRx.Replace(lcX, "$1" + CHR(13) + CHR(10))
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform