0

I have a strings like 1 - Copy (2) 2 - Copy (2) 3 - Copy (2). Here I want replace string which contains Copy (2) with string demo.

  • 1 - Copy (2) to demo

  • 2 - Copy (2) to demo

  • 3 - Copy (2) to demo

I tried like ^.*Copy (2).*$ but it is not working.

H C
  • 1

1 Answers1

0

You need to escape the parenthesis: .*Copy\ \(2\).*

treyhakanson
  • 4,611
  • 2
  • 16
  • 33