# Unable to do lucene regex query ending with backslash

**URL:** <https://discuss.elastic.co/t/unable-to-do-lucene-regex-query-ending-with-backslash/357745>\
**Category:** Elasticsearch\
**Created:** [April 18, 2024, 7:56pm UTC](https://discuss.elastic.co/t/unable-to-do-lucene-regex-query-ending-with-backslash/357745 "2024-04-18T19:56:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![fortnite](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/fortnite/32/133657_2.png) [@fortnite](https://discuss.elastic.co/u/fortnite)\
**Post date:** [April 18, 2024, 7:56pm UTC](https://discuss.elastic.co/t/unable-to-do-lucene-regex-query-ending-with-backslash/357745/1 "2024-04-18T19:56:28Z")

</div>

Hello,

It seems I am unable to combine queries if one of them ends with a backslash.  
This lucene query fails:

```auto
field:(/a\\/ OR /b/)

```

But these are just fine:

```auto
field:(/a\\/)
field:(/b/)
field:(/a/ OR /b/)
field:(/b/ OR /a\\/)

```

Same with AND

```auto
parse_exception: Cannot parse 'process.working_directory:(/a\\/ OR /b/)': Lexical error at line 1, column 41. Encountered: <EOF> after prefix "/)" (in lexical state 2)

```

We're on 8.13.2
