osx support

updated the explain tool for osx support (BSD sed uses -E rather than -r for extended regex)