Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
RegEx interface
Message
De
13/06/2008 13:06:07
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Titre:
RegEx interface
Versions des environnements
Visual FoxPro:
VFP 9
Divers
Thread ID:
01323910
Message ID:
01323910
Vues:
60
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 Cortiel
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform