Thursday, August 27, 2009

Re: Regex help

Hmm I guess a macro is indeed much better but anyway I worked out a regex for it too:

The line:
^(.+);(.+);(.+);(.+);(.+);(.+);(.+);(.+);(.+);(.+);\|.?$
the replacement: \1;\2;\3;\5;\6;\7;\8;\9;\10;|\4

If you need to shuffle more I guess the regex comes in handy...

...but somehow I could not get this translated back in vim's regex

Cheers,
Bastiaan


Tomas Kramar wrote:
2009/8/25 Marcelo Sabino <marcelo.sabino@gmail.com>:   
I'm having "troubles" with ER on vi. Let me explain. I have this data 03;14;Production;trombetas;Xeon;RHEL;-;PPE;-;F1-A0.3;| and I want to copy the data of third field to the last field, like this 03;14;Production;trombetas;Xeon;RHEL;-;PPE;-;F1-A0.3;|trombetas How can I do this magic?     
 Why don't you use a macro? It seems better suited for this type of task to me.  -- Tomas     

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

No comments: