I am flatting an Angular translation file and I need to do a search replace in VScode on the translate key. I need to clip off all that comes before the final key and return that to the replace. The keys will only be at most 3 levels deep. The words below of key and keepThisInReplace are arbitrary and will be different words. Examples below.
Search String Options:
'key1.keepThisInReplace1' | translate
'key1.key2.keepThisInReplace2' | translate
'key1.key2.key3.keepThisInReplace3' | translate
'anyWord.AndLevelAmount.UpTo3AtLeast.anyWordToKeep' | translate
Do not find in search:
'../../assets/images/
'./../assets/images/
'.......
'path').join
'staging.site
etc...
The above should be replaced as:
'keepThisInReplace1' | translate
'keepThisInReplace2' | translate
'keepThisInReplace3' | translate
'anyWordToKeep' | translate
What I am trying that is not working - Looks like '\w[^.].\w*.*\w*. will work. will almost work - picks up on 'path').join and 'staging.site still.
The keys above all do have {{ in front of them. But if I lock in on the {{ then I have to return it in the replace. Example = {{ key1.key2.keeptext | translate }} = {{ keeptext | translate }}