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

Click here to load this message in the networking platform