Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: regex problem

by dimmesdale (Friar)
on Jul 23, 2002 at 13:52 UTC ( [id://184411] : note . print w/replies, xml ) Need Help??


in reply to regex problem

If you know its the only brackets in the file, try:

$data =~ s/[\[\]]//g;

Or, to be safe, if the brackets are always around sbs, try:

$data =~ s/\[(\\sbs)\](.*)/$1$2/;