 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
bqw371
Joined: 26 Nov 2008 Posts: 32
|
Posted: Fri Jan 15, 2010 5:41 am Post subject: Regex assistance with US zip codes |
|
|
Hi all. I need assistance creating a regex to remove commas that should not have been entered into number sets (U.S. zip codes).
,11778, - This is a valid zip code within a CSV file.
,1,0566, - Invalid - Should be ,10566,
,30,052, - Invalid - Should be ,30052,
,113,61, - Invalid - Should be ,11361,
,1177,8, - Invalid - Should be ,11778,
Any help would be appreciated |
|
| Back to top |
|
 |
jaco0646
Joined: 07 Oct 2006 Posts: 3113 Location: MN, USA
|
Posted: Fri Jan 15, 2010 6:12 am Post subject: |
|
|
| Code: | var =
(
,11778, - This is a valid zip code within a CSV file.
,1,0566, - Invalid - Should be ,10566,
,30,052, - Invalid - Should be ,30052,
,113,61, - Invalid - Should be ,11361,
,1177,8, - Invalid - Should be ,11778,
)
MsgBox,% RegExReplace(var,"(,\d{1,4}),","$1") |
|
|
| Back to top |
|
 |
bqw371
Joined: 26 Nov 2008 Posts: 32
|
Posted: Fri Jan 15, 2010 6:19 am Post subject: |
|
|
jaco0646,
Thank you friend! This will help immensely!!
Works as expected  |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|