I have a variable of addresses and I would like to capture just the name of the street with a regular expression. This is without the street type, address number, or cardinal direction. There are some errors in formatting but all characters are in capital letters. So,
ought to return
So far I've got
But every time that I try to run it, I get an error saying
and it sets all values to missing.
Code:
2038 W MAIN AVE 2038QWEW S JEFFERSON AVENUE 33 NORTH CALIFORNIA STREET 53371 WASHINGTON AVENUE 1600 E PENNSYLVANIA AVE WEST9 67ST ST E171 23RD STREET G171 N121ST STREET 13 NM ROUTE 66
Code:
MAIN JEFFERSON CALIFORNIA WASHINGTON PENNSYLVANIA 67ST 23RD 121ST NM
Code:
gen street_name = regexs(0) if(regexm(address, "\b(?:(?:WEST|NORTH|EAST|SOUTH)\d*|(?!^)[NEWS](?![a-z])) *(\S+)")
Code:
regexp: ?+* follows nothing
Comment