Oh wise seekers of the Perl Wisdom, I come seeking help. This is, I am sure, a novice question and most likely a stupid one... But I've tried everything I can think of and can't seem to get this to work. I ran into an issue where words in parentheses are not being removed from a regex as wanted... The goal is to have anything inside of the curly braces (including the curly braces themselves) to disappear from the string. This works for all circumstances except for when there is a set of parentheses in the text.. I tried escaping the parentheses "\( and \)", but it was to no avail.. I understand that the parentheses are grouping tools in regex, but I figured escaping them would fix that problem, and it did not...
my $text = "to { (This Word) }";
my $remove = "{ (This Word) }";
$text =~ s/\R//g;
$text =~ s/$remove//;
print $remove, $/, $/;
print $text;
Output:
{ (This Word) }
to { (This Word) }
Looking for someone to shed some light on the situation, as it's holding up my production. Again, I'm sorry for I'm sure this is a simple thing to fix..