I have street address and I want to replace the street direction with blank string.
this are the streets E, W, S, N, NE, NW, SE, SW which I want to replace with blank string
I have tried this regex /((e|w)|(n|s)(e|w)?)/i to replace the direction, but this replacing all the instance characters present in regex.
I would like convert street address like following -
"123 Main Street S" => "123 Main Street"
"E 123 Main Street" => "123 Main Street"
"SE 123 Main Street" => "123 Main Street"
"123 Main Street, SW, US" => "123 Main Street, US"
"123 Main Street, s, USA" => "123 Main Street, USA"
ioption rather than directly writing the upper case letters when you are only looking for upper case letters.Einapartment 82E) using just a regex and without an AI or any kind of relevant database.upper caseorlower casesoiis used.