# Regexp for ES

**URL:** <https://discuss.elastic.co/t/regexp-for-es/232868>\
**Category:** Elasticsearch\
**Created:** [May 15, 2020, 6:49pm UTC](https://discuss.elastic.co/t/regexp-for-es/232868 "2020-05-15T18:49:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ebdavison](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ebdavison/32/47575_2.png) [@ebdavison](https://discuss.elastic.co/u/ebdavison)\
**Post date:** [May 15, 2020, 6:49pm UTC](https://discuss.elastic.co/t/regexp-for-es/232868/1 "2020-05-15T18:49:56Z")

</div>

I have a regex that I have been using outside of elasticsearch and am needing to convert to a query:

```auto
(\sprivilege::|\ssekurlsa::|\scrypto::|\skerberos::|\slsadump::|\sprocess::)

```

I know from the documentation that the `\s` is out but I have a couple questions about rewriting this for ES:

1. Not getting any results with `*privilege::*`. But I do get results if I remove the `::`. Why is that?
2. Do I need to query the `field.keyword` rather than the `field`?
3. Also no luck with the `|` operator. Does need to be written as multiple `bool` \> `should` clauses?

Thanks in advance.

---

<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:** [June 12, 2020, 6:49pm UTC](https://discuss.elastic.co/t/regexp-for-es/232868/2 "2020-06-12T18:49:58Z")

</div>

Closed on June 12, 2020, 6:49pm UTC

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