0

I have a string like this:

"test", "test2", "test3" 

I want to replace test* with some value. that means it would look like this after substitution:

"abc", "abc", "abc" 

This what I tried so far:

:s/test\(\d\)/abc/g => didn't work as expected. :s/test\p/abc/g => deletes quotes in first occurrence. :s/test\d/abc/g => first occurrence remains unchanged. 

Could you please me help with the right syntax.

1 Answer 1

5

substitute 'test' followed by zero or more digits:

:s/test\d*/abc/g 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.