I've got a data set where a majority of the Address fields contains "ATTN: firstname lastname ### Address", see below, and I'm trying to only pull out the actual street address and not any of the ATTN: or names before the actual address. It seems like I'll need a RegEx/Formula Tool to help accomplish this but I'm having a disconnect on what RegEx operators to use in my expression. Any help will be greatly appreciated:
From This:
ATTN: MATTHEW OR MARC LASTNAME 1234 WINTON ROAD |
ATTN: RON LASTNAME 123 EAST 2ND STREET |
To This:
1234 WINTON ROAD |
123 EAST 2ND STREET |
Solved! Go to Solution.
Looks like that was the trick, thanks Joe! Now I'll try to decode " [^\d]*(.*) " to better understand.
Does this help:
[^\d] any character that is not a digit
* zero or more times
( begin capture group
. any character
* zero or more times
) end capture group
The $1 references and returns the characters within the capture group
This will exclude all characters before the first digit character found, and only return character that are or after the first digit character
When I saw [^\d], I remembered a shorthand version of: \D
Here are some others....
The basic ones are:
http://www.andrewgoodricke.com/blog/regex-shorthand-classes/
@Joe_Mako and @MarqueeCrew - you are the RegEx kings. It's not that I don't like RegEx, I'm just always worried that I may accidentally blow up something, or cut my finger off in error, or short out the power to some subset of the country :-)
I really think there's fertile ground in folks like you who have learned how to work productively with RegEx doing a quick tool Mastery with @MattD or a live training with @JoeM because RegEx really is powerful once you get your head 'round it, and you both have been such active and helpful contributors in this space!
Good thinking, @SeanAdams ;) It's no substitute for @Joe_Mako or @MarqueeCrew's expertise, but we already have a Regex Tool Mastery that goes through the different match options and pattern syntax if you guys would like to see anything added!
Hopefully, this will help keep the accidents to a minimum :P
User | Count |
---|---|
106 | |
82 | |
70 | |
54 | |
40 |