2008/12/2 Shade <[EMAIL PROTECTED]>:
>
> Hello everyone. I'm gonna paste an example of what i want to do. Let's
> imagine that I have this code:
>
> <p id="already_registered">
>
> And i wanna copy id="already_registered" in a register, for example
> the register "P". How can i do that, and how can i paste it back
> later?

In what situation?  A script?  In normal mode?

I'm sure there are better ways of doing this, but one that springs to
mind for scripts is:

let ml = matchlist(getline('.'), '<p \(id="[^"]*"\)>')
let @P = ml[1]

Of course, you may need to bulk it out to check that the regexp
actually matches etc

For pasting, either use setline() or :put

:help matchlist()
:help match()
:help let-@
:help setline()
:help :put

Hope that helps,

Al

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

Reply via email to