I want to replace old validation with the new validation. But the new validation regex is removing $() from Regex.
$oldValidation="<RegexPattern>^[\da-zA-Z\s+()\-']+$</RegexPattern>"
$newValidation= "<RegexPattern>^[\w\s,.;+&'""!?$()@%]*$</RegexPattern>"
$_.Fields["Parameters"].value -replace $oldValidation, $newValidation
But the newValidation is removing $() from regex and showing it like this
<RegexPattern>^[\w\s,.;+&'"!?@%]*$</RegexPattern>