So I have addresses that have a zip in one field, and I want to extract the zip to a new field. Literally, the simplest regex that you can do.
This works fine in Python and returns 97321:
import re
address = '97321'
postal_code = re.search(r'.*(\d{5}(\-\d{4})?)$', address)
print(postal_code.group())
In Pro, in Calculate Field it acts like postal_code is None every single time, but I dont know because there is no way to properly debug this so I have no idea what is wrong. So please tell me what the secret trick is to get regex to work like it is supposed to in every other piece of software on earth.