I have a string that i am want to remove punctuation from.
I started with
sed \'s/[[:punct:]]/ /g\'
But i had problems on HP-UX n
Can be handled using the regex capture technique too (Eg: here below) :
echo "narrowPeak_SP1[FLAG]" | sed -e 's/\[\([a-zA-Z0-9]*\)\]/_\1/g'
> narrowPeak_SP1_FLAG
\[ : literal match to open square bracket, since [] is a valid regex
\] : literal match to square close bracket
\(...\) : capture group
\1 : represents the capture group within the square brackets