validate for street

Your question doesn't make sense. Do you mean a regular expression that will match 'Road' in each of those? If so, it's easy /Road/, but I suspect you'll want to expand your question a bit.

-Rob

Rob Biedenharn http://agileconsultingllc.com
Rob@AgileConsultingLLC.com

Rob Biedenharn wrote:

ok i ask so:
is this ok for like this "The Road", "The Road 12", "Road", "On the
Road 89":
/^[[:alpha:]]+(\s{1})*([[:alpha:]])*(\d)*$/

Try it yourself in irb :slight_smile:

Fred

Hello Guy wrote:

/^[[:alpha:]]+(\s{1})*([[:alpha:]])*(\d)*$/

Uh, what does (\s{1})* do?

In general, you cannot validate at this level of detail, because addresses like "The Batman, c/o Gotham City PD" will always fail. With terrible consequences...

In general, you cannot validate at this level of detail, because addresses like
"The Batman, c/o Gotham City PD" will always fail. With terrible consequences...

hmm, what do you propose?

Reward your customer, such as with free software, for providing correct info? (-: