How to keep same substrings in vim regex

Posted by invisiblerhino on Stack Overflow See other posts from Stack Overflow or by invisiblerhino
Published on 2010-04-21T14:29:58Z Indexed on 2010/04/21 14:43 UTC
Read the original article Hit count: 176

Filed under:
|
|
|

Hi everyone. I'd ideally like a vim answer to this:

I want to change

[*, 1, *, *] to [*, 2, *, *]

Here the stars refer to individual characters in the substring, which I would like to keep unchanged. For example

[0, 1, 0, 1] to [0, 2, 0, 1]
[1, 1, 1, 1] to [1, 2, 1, 1]

If people know how to do this in perl or python or whatever, that would be equally good. Cheers

© Stack Overflow or respective owner

Related posts about vim

Related posts about regex