Question

:%s/早上好/good morning/g can substitute 早上好 with good morning, but :%s/\(早上好\s+\)\+/good morning/g can not substitute 早上好 早上好 with good morning .
How can i write the right regular expression in vim?

Was it helpful?

Solution

Try this:

%s_\(早上好\s*\)\+_good morning_gi   
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top