Answer the question
In order to leave comments, you need to log in
How to write a regular expression in perl to remove parentheses in a string?
Help with a regular expression on Perl..
It is necessary to remove everything in brackets (and square ones), including the brackets themselves (square ones too), an example of a string.
The Wall Experience Edition (2011 - Remaster)
Mellon Collie and the Infinite Sadness (2012 - Remaster) [Explicit]
Thank you.
Answer the question
In order to leave comments, you need to log in
$text = "The Wall Experience Edition (2011 - Remaster)\nMellon Collie and the Infinite Sadness (2012 - Remaster) [Explicit]\n";
$text =~ s/[\[\(].*?[\]\)]//g;
print $text;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question