Home > Software design >  VSCode: change a word using regex
VSCode: change a word using regex

Time:08-04

I'm trying to change all words that finish by _was to _before_last_save

Regex: \b((\w ))_was Replace: $0_before_last_save

The problem is that it changes user_was by user_was_before_last_save

CodePudding user response:

This might be the combination you want:

Regexp: \b(\w )_was

Replace: $1_before_last_save

Even though this is not yet "all words that finish by _was" but alla words concat to _was and potentially something else

this will match also

anything_wasAnythingelse --> anything_before_last_saveAnythingelse

this probably would be a better fit:

Regexp: \b(\w )_was\b

  • Related