Hello Team,
I'm tryting to retrieve an specific length for digits in a string field, I'm using a Reg_Ex Formula to do this [ Regex_replace([field1],"[^\d]+"," ") ] and I'm getting almost what I need since with the formula I'm retriving only digits from the field however I exactly need to pull only the values with 7 digits only which are separeted by " ". is there any way to this more friendly?
Field 3 should be my desired result.
Solved! Go to Solution.
I would use the RegEx tool and Parse. You would keep RegExOut2 as your results.
Try the following formula:
Regex_replace([Field1],".*\s([\d]{7})(?:$|[\s]+).*","$1")
This will look for any 7 digit value that is prefaced by a space and then immediately preceded by either a space or an end of line character. The ([\d]{7}) is a marked group, looking specifically for 7 digits, and is also the corresponding "$1" in the "replace value" of the formula. This leaves us with only the matching number.