Powerful Regular Expressions (RegEx) Perform Minor Computing Miracles—This Part 1 Uses Extracting US Zip Codes from Street Addresses to Introduce Regular Expressions as Merely a Set of Confusing Wildcards
In my last blog, “Parsing and Pasting One-Line Street Addresses (AutoHotkey Multi-Paste Trick)“, I added one-line street addresses to my MultiPaste.ahk script. That short AutoHotkey app uses a few Regular Expressions (RegEx) to identify and isolate key information:
Five-digit US zipcodes.
- UK postal codes.
- Remove excess tab characters in the results.
- Identify date formats.
I used RegEx functions for these problems because the basic string functions just didn’t offer the power needed without convoluted coding. RegEx provides fairly simple solutions (although possibly confounding to the neophyte).