Start a new topic

Use RegEx to insert comma and space

I am putting the Long Address regex dictionary to good use and it is working well. My nemesis is a pesky comma. Let me start with an example:

  • Address provided: 234 w. ln. apartment #3b.
  • Result: 234 West Lane Apt. #3b

The result is pretty good. Except a comma space is required to precede Apt.

So following any kind of street, road, lane, avenue, etc. etc. can be EOL or comma

Apt./Unit/Suite must be on the same line, preceded with comma space

Like this: 234 West Lane, Apt. #3b

How, oh HOW, do I get the comma space in there?

Please, someone help or I am doomed to be in the company of Zaphod Beeblebrox for the rest of my natural life. Please don't let that happen.

Login or Signup to post a comment