I am not familiar with using Text pad's regular expressions, but I figure there must be a way to do this. I have a section of a line I want to remove--but the numbers at the end will not always be the same. Example:
NM1*72*1*RODRIGUEZ-BAEZ*NORBERTO****34*596054574~
I want to delete the **34*#########~ (The # represents 9 numbers)
Replace it with ~
But, since the numbers are different after the *34*--I am not sure how to do this. Can anyone help me?
Thanks, TM
Find and replace with a delete.
Moderators: AmigoJack, bbadmin, helios, MudGuard
-
ben_josephs
- Posts: 2464
- Joined: Sun Mar 02, 2003 9:22 pm
This assumes you are using Posix regular expression syntax:Find what: \*\*34\*[0-9]{9}~
Replace with: ~
[X] Regular expression
If the text you want to delete is always at the end of the line, you may want to put a $ at the end of the regular expression:Configure | Preferences | Editor
[X] Use POSIX regular expression syntax
Find what: \*\*34\*[0-9]{9}~$
Replace with: ~
[X] Regular expression
-
tmendoza
- Posts: 2
- Joined: Mon Jan 28, 2008 5:09 pm
THANK YOU!
This is the first time I have used a community forum like this and I have not used expressions in Text Pad before. I am grateful for such a quick response and maybe I can help someone else in the future! 