Replace nth orrurrence of char

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
sqtchman74
Posts: 1
Joined: Fri Feb 01, 2013 4:49 pm

Replace nth orrurrence of char

Post by sqtchman74 »

I have a text line that I need to fin every 10th orrurrence of a "^" and replace it with a line feed, how do I do that?
ak47wong
Posts: 703
Joined: Tue Aug 12, 2003 9:37 am
Location: Sydney, Australia

Post by ak47wong »

Enable POSIX regular expression syntax in Configure > Preferences > Editor. Then perform a Replace operation with the following parameters:

Find what: (([^^]*\^){9}[^^]*)\^
Replace with: \1\n

Select Regular expression and click Replace All.
Post Reply