I have to remove the extension from a filename, and I was using this:
preg_replace('/\\.[^.\\s]{3,4}$/', '', $filename)
I want to know what is the sed equivalent of this. My current approach is this:
$(echo $filename | cut -f 1 -d '.')
but it does not work all the time.
and
Do regex and sed have same expressions for matching and the syntax is different or the expressions also change?