Re-implemented the scanner logic to be configurable, based upon regular expressions.