Quantcast
Channel: CodeProject Latest postings for Regular Expressions
Viewing all articles
Browse latest Browse all 224

Why does this work but this doesn't

$
0
0
This works without the $ but I need it to work from the end of the line not the start of the line.

Working:
(\b[A-Za-z]{1}[A-Za-z]+\b)


Not Working:
(\b[A-Za-z]{1}[A-Za-z]+\b)$


What I'm trying to do is grab the street type from an address which works fine using just
[a-zA-z]+$
When the address is like "123 Easy Street" but it doesn't work well when there's a street direction afterwards like "123 Easy Street N". I'm trying to skip over the single character direction indicator and match "Street" whether the single character is there or not, but it's also not always "Street" as it could be avenue, crescent, drive, highway, road, etc. I think my line above will do what I need but I can't get it to work with the $ to read backwards. Any help would be appreciated!

Viewing all articles
Browse latest Browse all 224

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>