Updated regular expression highlighting

- The highlight function should now work correctly with "|" inputs and
"(some text)" inputs. All matches in a line are now highlighted instead
of just the first match.

- Added some error catching for certain inputs (*, |, and ?) which, if
input, would cause an infinite loop and a frozen browser.