Hi,
I'm trying to search and replace data in a text file using TextPad.
I'd like to replace anything in the file that is between parentheses with a comma.
So
Necturus maculosus (Rafinesque, 1818) Mudpuppy
Necturus punctatus (Gibbes, 1850) Dwarf Waterdog
Necturus punctatus lodingi Viosca, 1937 Mobile Dwarf Waterdog
Necturus punctatus punctatus (Gibbes, 1850) Dwarf Waterdog
Will become
Necturus maculosus , Mudpuppy
Necturus punctatus , Dwarf Waterdog
Necturus punctatus lodingi Viosca, 1937 Mobile Dwarf Waterdog
Necturus punctatus punctatus , Dwarf Waterdog
There are thousands of instances like this.
Any ideas?
I can usually use basic regular expressions but I often get stumped when special characters are part of what I want to replace or delete.
TIA
Trouble with parentheses in Regular Expressions
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
- s_reynisson
- Posts: 939
- Joined: Tue May 06, 2003 1:59 pm
Welcome to the forum joezeppy!
I find life a lot better since I started using POSIX regex's
Find \([^)]*\)
Replace ,
I have used POSIX regular expression syntax, which can be selected from the Editor page of the Preferences dialog box. HTH
I find life a lot better since I started using POSIX regex's
Find \([^)]*\)
Replace ,
I have used POSIX regular expression syntax, which can be selected from the Editor page of the Preferences dialog box. HTH
Then I open up and see
the person fumbling here is me
a different way to be
the person fumbling here is me
a different way to be
I'll give it a try
Thanks so much.
I'll give it a try.
*Update*
Holy Cow. It worked perfectly.
Thanks so much.
The world is so much better for sharing people like you.
Thanks!
One more thing. Do you think it is a good idea to just keep my TextEdit set to POSIX? (I get that impression from your post).
I'm just wondering if there are any other effects that I should be concerned about. I use TexPad mostly for text and data manipulation, to massage spreadsheets and datafeeds, for normal writing, etc.
BTW, Thanks to TextPad.com!!!! This is the most useful program I have on my computer. I use it often and EVERY DAY. I love it.
I'll give it a try.
*Update*
Holy Cow. It worked perfectly.
Thanks so much.
The world is so much better for sharing people like you.
Thanks!
One more thing. Do you think it is a good idea to just keep my TextEdit set to POSIX? (I get that impression from your post).
I'm just wondering if there are any other effects that I should be concerned about. I use TexPad mostly for text and data manipulation, to massage spreadsheets and datafeeds, for normal writing, etc.
BTW, Thanks to TextPad.com!!!! This is the most useful program I have on my computer. I use it often and EVERY DAY. I love it.