apps: refactor regular expressions

Refactor code to utilize regular expressions to replace string
manipulation.  This will improve performance by reducing the amount of
log line parsing.

BUG=chromium:466247
TEST=ran "grunt test" and manually checked multiple shill logs

Change-Id: I977d03843e1dfaef1434a11a1953587dd1f21b6d
10 files changed