I tried to use a regular expression ^10AB[0-9]{8}$ to match string that start with "10AB" and end with 8 digits, but seems Elasticsearch does not support "^" and "$" to match at the beginning and end. If I do not use "^" and "$" in the regular expression, I will get more than I want, for instance, 10AB00000001, 10AB00000001:count, etc. Note, 10AB00000001::count is not what I want.
So I just want to verify that does Elasticsearch support "^" and "$" to match at the beginning and end; if not, is there any other way to achieve the same purpose? Thanks.
According to the docs, Lucene patterns are always anchored so there is no need for anchoring with "^" and "$". For details please see the docs on regexp query, the docs on the regex query syntax and my example below:
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.