Page 1 of 1

Pattern match / macros

Posted: Wed Jan 29, 2003 4:34 pm
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

Re: Pattern match / macros

Posted: Wed Jan 29, 2003 5:41 pm
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.

Re: Pattern match / macros

Posted: Fri Feb 07, 2003 1:35 pm
by Derek Roberts
Thanks very much for this ...
It does exactly what I need.
I guess I ought to brush up on my regexp!