Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Replace character expression
Message
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01471799
Message ID:
01472124
Vues:
40
>Try
>
>lcStr = "a [1-2] b [2-3] c [3-4] d [4-5] e [5-6] ... [9-10]"
>
>loRegEx = NEWOBJECT("VBScript.RegExp")
>loRegEx.Pattern = "\[([1-9])-([1-9])\]"
>loRegEx.Global = .T.
>lcNewStr = loRegEx.Replace(lcStr, "[0$1-0$2]")
>
>loRegEx.Pattern = "\[([1-9])-([1-9]\d)\]"
>lcNewStr = loRegEx.Replace(lcNewStr, "[0$1-$2]")
>
>
>? lcStr
>? lcNewStr
fantastic sergey - many thanks - works perfectly for me. I will spend the next couple of hours trying to figure out exactly what you've done.

k/
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform