I've got a regex issue that I've been trying to fix for hours and I can't figure out what I'm doing wrong. Here's the regex pattern and example data:
https://regex101.com/r/X0Oein/1
In my example script below, LocalsContent contains the exact same data as shown in the link above.
Code: Select all
regexComment_Out_Pattern := "^\h*(""ssfsfsubnet_service_endpoint"")\s*=\s*(?:\[[^\]]*|\{[^}]*|""[^""]+)"
clipboard := regexComment_Out_Pattern
msgbox % regexComment_Out_Pattern
; clipboard := LocalsContent
msgbox % LocalsContent
; Replace with # comment block
LocalsContent := RegExReplace(LocalsContent, regexComment_Out_Pattern, "# Commented out by `Terraform_locals_Locals_Manipulator`" . "`n # $0`n")
msgbox % LocalsContent
The regex pattern is 100% correct, as when I dump the regex pattern to clipboard and paste it into regex101, it works perfectly.
Any help would be much appreciated.