Start a new topic

RegEx to Format and Abbreviate Street Names

Here is a large set of regular expressions designed to replace a street name with its standardized USPS abbreviation. (See the "Street Suffixes" and "Secondary Units" tabs). It takes an address such as "15800 Countrydrive Avenue blvd., apt. 1506" and formats it to "15800 Countrydrive Ave Blvd Apt 1506". This isn't perfect as it mistakes an intended part of the street name as an abbreviation. Hence "Avenue" becomes "Ave" and some of the meaning is lost. However if the street name includes a possible abbreviation (such as "Countrydrive") then the abbreviation is appropriately NOT applied.
Regular Expressions - Street Suffixes & Secondary Unit Designators.xlsx (UPDATED BY A LATER POST)

The list includes 202 Street Suffixes and 24 Secondary Unit Designators. The "Use Regular Expressions" check box must be painstakingly ticked for each item. The form needs a "Check All" button or link.

image


There are two regular expressions that should also be included, BLANK and PO Box. They are:

1. BLANK --> , AND \. (two match-on entries)
2. PO Box --> (?i)\b((P\.O\.)|(P\. O\.)|(PO BOX)|(POBOX)|(BOX)|(POB)|(P O BOX))\b

Hopefully someone can modify the regular expression format to restrict alterations to only the last word before the Secondary Unit Designator. That would be helpful.

1 person has this question

I would guess that first it is replacing " Apt" with ", Apartment" and then it is not recognizing "Ave," as being Avenue.
Hi Marcy,

If other Regular Expression dictionaries are working fine, then the address one should too. I was just able to use it successfully in a Blackbaud-hosted database last week, and we haven't received any reports of a greater issue among other users, to my knowledge.

A few things to try would be to try saving the downloaded copy of the dictionary in XLSX format (if it's not already), make sure you're creating a new dictionary rather than adding to an old one, and make sure you apply the correct copy in your profile. You may want to try manually typing in one of the translations in a fresh dictionary to narrow down whether it's the copy/paste or the dictionaries themselves causing this issues.

Amanda Tetanich, bCRE
Software Trainer | Omatic Software
Tammy,

Take a look at this post: http://www.omaticsoftware.com/Forums/tabid/108/aft/1076/Default.aspx

It may not be exactly what you are looking for but it will get you on the right track.

I'm very new to ImportOmatic and RegEx.  I want to import addresses that have been abbreviated, i.e. I need to set up a RegEx to change rd to Road and st to Street, etc. I was excited to see this topic and copied the Address abbreviations (Long) into my dictionary as instructed - but it does not work for me at all.  As this is entry is over a year old I wonder if there has been an update or change at all?

thanks

Jenny

Thanks, I'll give it a try.  Stay tuned. 

Hi,

I'm testing out the Address Abbreviations (Long) but am running into a problem with Ave, St., etc when I am entering an apartment abbreviation as well.
I'm entering 234 West Ave Apt. 45 and it's giving me 234 West Ave, Apartment 45. Does anyone know the solution to this? I would like for Ave to be spelled out.

Thanks!




One thing to check is that the "use regular expressions" is checked off for each entry. They way to do it automatically is to have a third column in the excel spreadsheet set to TRUE. It might already be on there but just make sure.
I'm using the Address Abbreviations Long and Short Directions. We like our addresses to read 123 Anywhere Street, Apt. 7
I need to have a dot (.) after Apt. The regex Value to Match: , Apartment and the value to match is (?i)(? I can't figure out where to insert the dot to have it come out correctly. I've tried changing the value to match to Apt. but the dot just won't come through.
Thanks for any help.
Barbara
Patrick,
Thanks a million for making the new dictionary! I love it and I named it "Patrick's Amazing Address Dictionary" in your honor:) Also, we were using version 2.2.2 of IOM so that probably contributed to my other issue. Thanks again!
Katherine Flowers
Huntsville Hospital Foundation

Jenny,


Here are the results from the expression I posted.  They appear to be working in the example you gave.

image

Sorry for the late reply, I have been on vacation. Here are the lines from my dictionary for Ave. to Avenue and St. to Street.

(?i)\b(avnue\.?|avn\.?|avenue\.?|avenu\.?|aven\.?|ave\.?|av\.?|Ave.\.?)\b 

(?i)\b(strt\.?|street\.?|str\.?|st\.?|st.\.?)\b 

Any help you can give would be greatly appreciated.
Our organization is located in St. Charles. We have created a dictionary to convert data coming in to be St. however when we run the import we are getting values containing two periods. (i.e. St..) does anyone know what we are doing wrong? We are matching on the values below:
\bSaint\b
\bsaint\b
\bSt\b
\bst\b
Jenny, can you right-click on your "Street abbrev" dictionary in the list of dictionaries to export it to CSV and post it here? We'll take a look at it.

image


Thanks,
Jeff


Greeting - I am trying to re-create the long abbreviations from the posted excel spreadsheet and am having some difficulties.  When I test the expression, for example st and I click on the test button I get st

Below is the expression I have.  I get this same issue for all others as well.  Thanks ahead of time. 


(?i)(?<= )(strt\.?$|strt\.?(?=,)|strt\.?(?= #)|street\.?$|street\.?(?=,)|street\.?(?= #)|str\.?$|str\.?(?=,)|str\.?(?= #)|st\.?$|st\.?(?=,)|st\.?(?= #))

 


NEVER MIND - I WAS HAVING A "DUH" moment - it's Friday, happy weekend. 


Can you replace ' Apt' with ', Apt'?

Login or Signup to post a comment