I\'m trying to use SED to extract text from a log file. I can do a search-and-replace without too much trouble:
sed \'s/foo/bar/\' mylog.txt
The Mac version of sed seems a bit limited. One way to work around this is to use a linux container (via Docker) which has a useable version of sed:
sed
cat your_file.txt | docker run -i busybox /bin/sed -r 's/[0-9]{4}/****/Ig'