Skip to content
Advertisement

Replace an exact substring in column value

The ‘Last year (2019)’ should be replaced with ‘LY’ I tried this but it did not work.

JavaScript

enter image description here

I have tried several regex attempts using ‘b’ but nothing seems to work. Any help is apprecciated

Advertisement

Answer

Following may help you here, you need to escape ( and ) to make it treat like as a literal character.

JavaScript

Following is the testing of above code:

JavaScript
Advertisement