I've been searching the forums for the last 15 minutes without sucess so I've decided to post a plea for help.
I need to zero pad ip addresses within a flat text file so I can then sort them correctly. ie 1.20.30.254 becomes 001.020.030.254
Can some kind soul post up a regular expression that will work with Textpad search/replace that to do this ??
IP address leading zero padding for sorting
Moderators: AmigoJack, bbadmin, helios, MudGuard
-
ben_josephs
- Posts: 2464
- Joined: Sun Mar 02, 2003 9:22 pm
You can't do it in one step in TextPad. Here's a way to do it in two steps:
Find what: \<([0-9])\>
Replace with: 00\1
[X] Regular expression
Replace All
These assume you are using Posix regular expression syntax:Find what: \<([0-9]{2})\>
Replace with: 0\1
[X] Regular expression
Replace All
Configure | Preferences | Editor
[X] Use POSIX regular expression syntax