Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
RegEx interface
Message
From
13/06/2008 13:06:07
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
RegEx interface
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01323910
Message ID:
01323910
Views:
59
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
Next
Reply
Map
View

Click here to load this message in the networking platform