Your RegEx is weird, replace
to control repeat. The
at the end is an error too.
Use last link to see a nice diagram of your RegEx, it may help to anderstand what is wrong.
Just a few interesting links to help building and debugging RegEx.
Here is a link to RegEx documentation:
perlre - perldoc.perl.org
Here is links to tools to help build RegEx and debug them:
.NET Regex Tester - Regex Storm
Expresso Regular Expression Tool
RegExr: Learn, Build, & Test RegEx
This one show you the RegEx as a nice graph which is really helpful to understand what is doing a RegEx: