# How to Use regexp to Find Keywords That Are All Lowercase

**URL:** <https://discuss.elastic.co/t/how-to-use-regexp-to-find-keywords-that-are-all-lowercase/106084>\
**Category:** Elasticsearch\
**Created:** [November 1, 2017, 6:47pm UTC](https://discuss.elastic.co/t/how-to-use-regexp-to-find-keywords-that-are-all-lowercase/106084 "2017-11-01T18:47:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![krmathieu](https://avatars.discourse-cdn.com/v4/letter/k/b5e925/32.png) [@krmathieu](https://discuss.elastic.co/u/krmathieu)\
**Post date:** [November 1, 2017, 6:47pm UTC](https://discuss.elastic.co/t/how-to-use-regexp-to-find-keywords-that-are-all-lowercase/106084/1 "2017-11-01T18:47:58Z")

</div>

Does anyone know the regex syntax to find all keyword fields for a string that do not contain any uppercase characters? I tried this as part of an aggregation filter and it did not work:

{ "regexp": {"segments.anchor.text.keyword": "^[^A-Z]+$"}}

This filter does not throw any errors but it returns zero results and I know for a fact that there are lots of anchor.text.keyword fields in the index that are all lowercase. If I remove this filter, the aggregation returns the expected results. Any help that anyone might be able to provide would be appreciated. Thanks.

Kevin

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 29, 2017, 6:59pm UTC](https://discuss.elastic.co/t/how-to-use-regexp-to-find-keywords-that-are-all-lowercase/106084/2 "2017-11-29T18:59:08Z")

</div>

Closed on November 29, 2017, 6:59pm UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
