So, I did a global undoable RegEx search and replace. I forgot to include the '
in the replace. Now I need to do a search on strings that match the below. It must not start with a '
and will have | translate
at the end. These are Angular translation keys - they can be all over in the template file (HTML). They always begin with {{, have | translate, and end with }}. Now the kicker is they could have spacing or line break issues (less likely but a chance). So it could be {{_ _ textToKeepAdd'To _ _ | _ _ translate _ _ }} The _ _ being spaces or a line break possibility.
Strings To Match (no beginning '):
anyText' | translate<other text or tags>{{ anyText' | translate{{ // line breakanyText' | translateanyText' | translate // line break
Strings Not To Match:
'anyText' | translate<other text or tags>{{ 'anyText' | translate'anyText' | translate
Return String Format:
'anyText' | translate
Example:
blahadskfjlksjdf' | translate = 'blahadskfjlksjdf' | translate'SkipMe' | translate = not found for replacement bc it starts with a '.And <other text or tags>{{ anyText' | translate = <other text or tags>{{ 'anyText' | translate
Here is the code that I biffed on - '(?:\w+\.){1,3}(?=\w+'\s+\|\s+translate\b)
I am going to need a group capturing/returning in the replace.