Click to See Complete Forum and Search --> : regular expression help - I need to match a Fullname AND an Address!
mcmcom
March 31st, 2004, 03:28 PM
Hi all,
I need to know the format for a regular expression that will find any amount of numbers at the beginning of the string, then text following that. For an address. It needs to be able to validate things like:
1 Fake St.
#1-1515 Fake St.
112451 Fake St.
1A-35 Fake St.
Anyone got a string?
thankx
mcmcom
March 31st, 2004, 03:33 PM
Forget that whole post.
I need to know this.
I have a Full Name Column with stuff like:
Fred Jones
Then I have a CITY column with stuff like:
Fort Worth
How can I distinguish between the two using regular expressions, keeping in mind that there would be no way to know a list of possible cities the data may relate to.
thanks
Craig Gemmill
March 31st, 2004, 04:25 PM
The two can be indentical, so without having a list of valid options to match it against, I don't think a regular expression can help you.
mcmcom
March 31st, 2004, 04:36 PM
that sucks. What about if the City column is ALWAYS beside a column with only TWO LEtters in it. Like a State.
The way the program logic goes is like this:
for i = 0 to Column.Count -1
if regex matches the phone pattern then
column name = phone
elseif regex matches the address pattern then
column name = address
elseif regex matches the zip code pattern then
column name = zip
....
.....
and so on.
next
In this loop, could i compare two regex's on two columns, something like:
if regex matches the city pattern AND regex2 in columns(i+1)
matches two letter pattern then
column name = city ??
That logic seems weird, there must be an easier way
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.