Sed to use extended regular expressions.

Sed commands have been updated to use extended regular expressions in the script. (-r)