Address validation using regular expression format - want to ignore case

Hello Everybody,

I’m trying to validate address field using regular expressions. For most part the line below works except ignoring case. For example rd works but not Rd and I like to rewrite the line below to so that the address validation is NOT case sensitive.

const matchAddress = /\d+(\s+\w+){1,}\s+(?:st(?:\.|reet)?|dr(?:\.|ive)?|pl(?:\.|ace)?|ave(?:\.|nue)?|rd|road|lane|drive|way|court|plaza|square|run|parkway|point|pike|square|driveway|trace|park|terrace|blvd)/;

you stick an i on the end.

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.