I would like to craft a case-insensitive regex (for JavaScript) that matches street names, even if each word has been abbreviated. For example:
n univ av should match N University Ave
king blv should match Martin Luther King Jr. Blvd
ne 9th should match both NE 9th St and 9th St NE
Bonus points (JK) for a “replace” regex that wraps the matched text with <b> tags.
You got:
You want:
So you do:
Voilà!
But I’m not done, I want my bonus points. So we change the pattern to:
And then:
Now we got:
So, we can write: