Initial changes to add support for regular expressions - debugging still required