Pattern match / macros

General questions about using TextPad

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

Post Reply
Derek Roberts

Pattern match / macros

Post by Derek Roberts »

Anyone know who to write a macro to turn this:

.f_tx_rdy_0(f_tx_rdy_0),
.jtdi(jtdo),
.rstn(rstn),
.f_rx_fail(f_rx_fail),
.cpu_RDY_n(cpu_RDY_n),
.f_rx_rdy_0(f_rx_rdy_0),
.clk(pclk),
.lclk(clk5),


into this:

.f_tx_rdy_0,
.jtdi,
.rstn,
.f_rx_fail,
.cpu_RDY_n,
.f_rx_rdy_0,
.clk,
.lclk,

i.e. find the open brace, then delete it and everything following up to and including the close brace ?

Thanks for any help,
Derek Roberts
Xenos

Re: Pattern match / macros

Post by Xenos »

What I usually do is record a macro and use the keyboard to acess, setup, and execute the find/replace dialog, and set it up to a regular expression find and replace. such as:

Find What: ^\(.*\)(.*),$
Replace With: \1,

Note: you may have to swap the escaped on non-escaped parantheses around, depending on whether you use the POSIX versions or not.
Derek Roberts

Re: Pattern match / macros

Post by Derek Roberts »

Thanks very much for this ...
It does exactly what I need.
I guess I ought to brush up on my regexp!
Post Reply