Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Michel Levy
  Where is Michel Levy?
 Michel Levy
 To: Jon Woolf
  Where is Jon Woolf?
 New Hampshire - United States
 Jon Woolf
Subject: RE: Regular expressions in VFP?
Thread ID: 289325 Message ID: 289363 # Views: 46 # Ratings: 2
Version: Visual FoxPro 9 SP2 Category: General VFP Topics
Date: Friday, December 31, 2010 8:44:54 AM         

> Is there a way to do regular-expression checks in VFP? Specifically, I have a table which contains a 'postal code.' This code might be:
> * a US old-style zip code, 5 digits NNNNN
> * a new-style US zip code, 5-4 digits, NNNNN-NNNN
> * a Canadian postal code, LNL NLN (where L = any letter, N = any digit)
> * a UK postal code, Lxxx NLL (L = letter, N = digit, x can be either)
> and possibly others.
> I currently have a block of code that parses the 'postal code' field character by character and decides what it is based on the results, but this code is slow and ugly and hard to enhance with new post-code forms. Is there a quicker, cleaner way to do it?
> -- Jon W.

take a look at

http://www.atoutfox.org/articles.asp?ACTION=FCONSULTER&ID=0000000748 (Regular Expressions in vfp - Gregory Adam)
http://www.atoutfox.org/articles.asp?ACTION=FCONSULTER&ID=0000000695 (RegExPatternHelper class - Gregory Adam)

Michel L


Regular expressions in VFP? Posted by Jon Woolf @ 12/30/2010 8:51:05 PM
RE: Regular expressions in VFP? Posted by Cetin Basoz @ 12/30/2010 10:38:18 PM
RE: Regular expressions in VFP? Posted by Michel Levy @ 12/31/2010 8:44:54 AM