error checking the regexp
prettier transactions
using constant name for func.
logging instead of fmt-printing
removed some bogus returns
checking the regexp before accepting it. using the correct log function name