Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
RegEx interface
Message
De
13/06/2008 13:41:19
 
 
À
13/06/2008 13:06:07
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Titre:
Versions des environnements
Visual FoxPro:
VFP 9
Divers
Thread ID:
01323910
Message ID:
01323919
Vues:
28
This message has been marked as the solution to the initial question of the thread.
>i have the following string:
>
>Peter Cortiel 860-555-11234 or
>Jack Kennedy (860) 555-1234
>
>and need to extract the phone#
>
>this should work but does not:
>
>lparameters tcText
>tcPassword = Alltrim(tcText)
>
>Local oRE
>oRE = CreateObject("VBScript.RegExp")
>oRE.Pattern = "^\+?\(?\d+\)?(\s|\-|\.)?\d{1,3}(\s|\-|\.)?\d{4}$"
>oResults = oRE.execute(tcText)
>For Each oResult in oResults
>  WAIT WINDOW oResult.Value
>Next
>RETURN
>
>
>what am I doing wrong extracting the phone number
>
>Thnaks
>
>Peter
___

Peter,

On first sight, remove the first and the last char from your pattern
Your pattern does not search in the string, you force the whole string to match with ^ and $
Gregory
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform