Re: regexp select and place elsewhere

2006-06-29 Thread Christian Ebert
* Jerin Joy on Thursday, June 29, 2006 at 14:28:51 +0530:
> I have data that looks like this
> 
> input [4:0] a.b.c.d;
> which I need to replace with
> input a.b.c.d [4:0] d;
> 
> ie. I want to copy a.b.c.d and place it after input and replace it
> with d after [4:0].

:s/\(\[[^]]\+\]\) \(\([a-z]\.\)\{3}\([a-z]\)\);/\2 \1 \4;/

does it for your example, but I don't know which other
requirements and/or restrictions you have.

c
-- 
_B A U S T E L L E N_ lesen!  --->> 


Re: regexp select and place elsewhere

2006-06-29 Thread Jerin Joy

Thanks guys, I was looking for the ()

Jerin

On 6/29/06, Vishnu <[EMAIL PROTECTED]> wrote:

Hi Jerin,

Use the following reg exp,

:%s/\(\[\d\+:\d\+] \)\(.*\.\)\(\i\+\);/\2\3 \1\3;/


:h \(


~VIshnu

> -Original Message-
> From: Jerin Joy [mailto:[EMAIL PROTECTED]
> Sent: Thursday, June 29, 2006 2:29 PM
> To: vim@vim.org
> Subject: regexp select and place elsewhere
>
> Hi,
>
> I have data that looks like this
>
> input [4:0] a.b.c.d;
> which I need to replace with
> input a.b.c.d [4:0] d;
>
> ie. I want to copy a.b.c.d and place it after input and replace it
> with d after [4:0].
>
> I'm fairly comfortable with regexp but I'm not sure how to select and
> copy the text to another place on the line.
> Could someone help me out here.
>
> thanks,
> Jerin
>
> --
> http://jerinj.blogspot.com/
> --





--
http://jerinj.blogspot.com/
--


RE: regexp select and place elsewhere

2006-06-29 Thread Vishnu
Hi Jerin,

Use the following reg exp,

:%s/\(\[\d\+:\d\+] \)\(.*\.\)\(\i\+\);/\2\3 \1\3;/


:h \(


~VIshnu

> -Original Message-
> From: Jerin Joy [mailto:[EMAIL PROTECTED]
> Sent: Thursday, June 29, 2006 2:29 PM
> To: vim@vim.org
> Subject: regexp select and place elsewhere
> 
> Hi,
> 
> I have data that looks like this
> 
> input [4:0] a.b.c.d;
> which I need to replace with
> input a.b.c.d [4:0] d;
> 
> ie. I want to copy a.b.c.d and place it after input and replace it
> with d after [4:0].
> 
> I'm fairly comfortable with regexp but I'm not sure how to select and
> copy the text to another place on the line.
> Could someone help me out here.
> 
> thanks,
> Jerin
> 
> --
> http://jerinj.blogspot.com/
> --



Re: regexp select and place elsewhere

2006-06-29 Thread Jerin Joy

I need to use regexp. there are a lot of lines like these. I can't
manually do it.

Jerin

On 6/29/06, Saurabh Jain <[EMAIL PROTECTED]> wrote:




On 6/29/06, Jerin Joy <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I have data that looks like this
>
> input [4:0] a.b.c.d;
> which I need to replace with
> input a.b.c.d [4:0] d;
>
> ie. I want to copy a.b.c.d and place it after input and replace it
> with d after [4:0].


Hi,
  you can try.
 // In non-insert mode press v to start visual mode
// Then use arrow keys to select the required text.
//After selecting, press "d" to delete the selected text.
// And paste it using "p" wherever you want.

Happy vimming
-Saurabh




--
"Busy Wasting Time"



--
http://jerinj.blogspot.com/
--


regexp select and place elsewhere

2006-06-29 Thread Jerin Joy

Hi,

I have data that looks like this

input [4:0] a.b.c.d;
which I need to replace with
input a.b.c.d [4:0] d;

ie. I want to copy a.b.c.d and place it after input and replace it
with d after [4:0].

I'm fairly comfortable with regexp but I'm not sure how to select and
copy the text to another place on the line.
Could someone help me out here.

thanks,
Jerin

--
http://jerinj.blogspot.com/
--