I have been trying to match a Regex query with a string that sometimes contains Regex "power" characters eg. (foo)bar
I am unable to directly effect whether or not these "power" characters are there. I have one solution which is to append a \ to every Regex "power" character but that solution is not ideal and increase the chance of the script missing some entries if I miss any of the "power" characters. e.g:
(($Regex_find_results -replace ')','\)') -replace '(','\(')
So is there a way to have Regex ignore all Regex rules inside part of a Regex query?
Regex with only Powershell code:
$Current_Replace_Regex = "($Regex_find_results)(«){2}[.\- ,\w]+(«){3} Other Matching text"
Regex with example:
$Current_Replace_Regex = "(example (1) here)(«){2}[.\- ,\w]+(«){3} Other Matching text"
Match Example (if brackets are escaped in the above Regex):
example (1) here««abc««« Other Matching text