in reply to Re^2: Substitution for braces
in thread Substitution for braces
you could substitute all ( in a string with the regex $string =~ s/\(/$cheesesauce/g;
Oh Goddess, look this code needs a lot of work, take a look at the following
I'm sure it's far from perfect, but an improvement on your current code nonethelessopen($FH,'<','file.txt'); $arr[$i]=join('',(<$FH>)); close ($FH); $arr[i] =~ /<cc>([\s\S]+?)<\/cc>/$1/; $arr[i] =~ s/&amp;/-/g; $arr[i] =~ s/&/-/g; $arr[i] =~ s/\(/-/g; # I assume $arr[i] =~ s/-$//; if (substr($arr[i],-1,1) eq '-') { $arr[i]=~ s/-$//g; # I assume you meant, though you've already done + it above }
|
|---|