Optimize Regex patterns with constant substrings.

Performance example: using tpch_parquet database

Constant string:
select count(*) from line item where l_shipinstruct REGEXP “^DELIVER IN PERSON$”;
4.22s -> 3.62s

Constant substring:
select count(*) from lineitem where l_shipinstruct REGEXP “IN”;
5.03s -> 4.12

Constant substring at beginning:
select count(*) from lineitem where l_shipinstruct REGEXP “^DELIVER”;
4.22s -> 3.82s

Constant substring at end:
select count(*) from line item where l_shipinstruct REGEXP “PERSON$”;
5.02 -> 3.83

Change-Id: Id1aa0511b023df6ef88678f2ecf5f348d5da3597
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/3829
Reviewed-by: Paden Tomasello <paden.tomasello@cloudera.com>
Tested-by: jenkins
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/3929