# Regular expression won't work when next to character that's been escaped

**URL:** <https://discuss.elastic.co/t/regular-expression-wont-work-when-next-to-character-thats-been-escaped/186549>\
**Category:** Elasticsearch\
**Created:** [June 19, 2019, 9:37pm UTC](https://discuss.elastic.co/t/regular-expression-wont-work-when-next-to-character-thats-been-escaped/186549 "2019-06-19T21:37:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jchris](https://avatars.discourse-cdn.com/v4/letter/j/85e7bf/32.png) [@Jchris](https://discuss.elastic.co/u/Jchris)\
**Post date:** [June 19, 2019, 9:37pm UTC](https://discuss.elastic.co/t/regular-expression-wont-work-when-next-to-character-thats-been-escaped/186549/1 "2019-06-19T21:37:31Z")

</div>

I'm trying to create a saved search and I have a field called "pipe\_name" and I need to find every time it equals [back slash][six lower case characters]. An example is \qudpcg.

this query finds **\qudpcg** :

```
{
  "query": {
    "regexp": {
      "pipe_name": {
        "value": "\\q[a-z]{5}"
      }
    }
  }
}

```

This Query doesn't return anything

```
{
  "query": {
    "regexp": {
      "pipe_name": {
        "value": "\\[a-z]{6}"
      }
    }
  }
}`

```

I can't get any regular expression or wildcard to work after the "\\", any thoughts?

---

<div class="post-metadata">

**Author:** ![lukas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukas/32/6812_2.png) [@lukas](https://discuss.elastic.co/u/lukas)\
**Post date:** [June 19, 2019, 10:11pm UTC](https://discuss.elastic.co/t/regular-expression-wont-work-when-next-to-character-thats-been-escaped/186549/2 "2019-06-19T22:11:25Z")

</div>

What kind of query are you doing? Have you tried asking in the Elasticsearch forums?

---

<div class="post-metadata">

**Author:** ![Jchris](https://avatars.discourse-cdn.com/v4/letter/j/85e7bf/32.png) [@Jchris](https://discuss.elastic.co/u/Jchris)\
**Post date:** [June 19, 2019, 10:26pm UTC](https://discuss.elastic.co/t/regular-expression-wont-work-when-next-to-character-thats-been-escaped/186549/3 "2019-06-19T22:26:52Z")

</div>

thank for the suggestion Lukas I'll move to there. To answer your question I was using a DSL query in Kibana's discovery pane.

---

<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:** [July 17, 2019, 10:26pm UTC](https://discuss.elastic.co/t/regular-expression-wont-work-when-next-to-character-thats-been-escaped/186549/4 "2019-07-17T22:26:56Z")

</div>

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