Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

basic zip code and state check...

Status
Not open for further replies.

angela4eva

Programmer
Apr 29, 2005
46
US
i am trying to write zip code and state validation checks in a vb6 form..
here i found a script to do zip chekc but i guess its in a different language any help appreciated

string REGEX_US_POSTCODE =
@"\b[A-Z][A-Z]\s{1,4}\d{5,5}\s?\-?\s?(\d{4,4})?\b";

Regex rx = new Regex(REGEX_US_POSTCODE, RegexOptions.IgnoreCase);
Match m = rx.Match(workingText);

if (m.Success)
{
pPostcode = m.Value;
}
 
Doing a search in this forum for "regular expressions" yields numerous threads, including this one which should get you started: thread222-1041617

HTH

Bob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top