Your test case doesn't have simple [something] in it. If you are willing to delete all of the brackets, not just the double ones, then a shorter more simple, tr statement can be used. Tr is in general faster than a regex with substitution and because its features are so limited, there is no need to escape the characters, so the expression is more readable.
use warnings; use strict; my $doc = q('C-3PO' or 'See-Threepio' is a humanoid robot character fr +om the [[Star Wars]] universe who appears in the original ''Star Wars +'' films, the prequel trilogy and the sequel trilogy.); $doc =~ tr/[]'//d; print "$doc\n"; __END__ C-3PO or See-Threepio is a humanoid robot character from the Star Wars + universe who appears in the original Star Wars films, the prequel tr +ilogy and the sequel trilogy.
In reply to Re: Remove double bracket and singe quotes
by Marshall
in thread Remove double bracket and singe quotes
by lobs
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |