I want to remove all special characters leaving only A-Za-z0-9.()[]
echo 'Some Movie Name! (2015) [1080p]' |sed -e 's/[^A-Za-z0-9.()[]]/./g'
Gives me this output:
Some Movie Name! (2015) [1080p]
This is what I want:
Some.Movie.Name.(2015).[1080p]
I cant figure out how to escape the "]" "]" doesn't work.
The closest I can get is this:
echo 'Some Movie Name! (2015) [1080p]' |sed -e 's/[^A-Za-z0-9.()[]/./g'
Some.Movie.Name..(2015).[1080p.
Then I can pipe it to sed again to remove double periods:
|sed 's/\.\././g'
'Some Movie Name! [dvdrip] (2015) [1080p]'