Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
But this does not work where the brackets contain only text. How can I strip out brackets containing any sort of text from a string? Or just empty brackets.$desc =~ s/\(.*?\)//gs;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Strip brackets and contents from string
by hippo (Archbishop) on Apr 11, 2016 at 14:45 UTC | |
by BrowserUk (Patriarch) on Apr 11, 2016 at 20:57 UTC | |
|
Re: Strip brackets and contents from string
by AnomalousMonk (Archbishop) on Apr 11, 2016 at 14:58 UTC | |
|
Re: Strip brackets and contents from string
by jellisii2 (Hermit) on Apr 11, 2016 at 15:06 UTC | |
|
Re: Strip brackets and contents from string
by james28909 (Deacon) on Apr 11, 2016 at 14:57 UTC | |
|
Re: Strip brackets and contents from string
by SimonPratt (Friar) on Apr 11, 2016 at 15:27 UTC | |
|
Re: Strip brackets and contents from string
by BillKSmith (Monsignor) on Apr 11, 2016 at 20:48 UTC |