# Regexp not matching special chars

**URL:** <https://discuss.elastic.co/t/regexp-not-matching-special-chars/98187>\
**Category:** Elasticsearch\
**Created:** [August 24, 2017, 8:37am UTC](https://discuss.elastic.co/t/regexp-not-matching-special-chars/98187 "2017-08-24T08:37:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dbrezoev](https://avatars.discourse-cdn.com/v4/letter/d/8baadc/32.png) [@dbrezoev](https://discuss.elastic.co/u/dbrezoev)\
**Post date:** [August 24, 2017, 8:37am UTC](https://discuss.elastic.co/t/regexp-not-matching-special-chars/98187/1 "2017-08-24T08:37:09Z")

</div>

First, I am new to Elasticsearch. I am trying to use regex search feature. It is working ok, except for the special chars. Ok I already have read on several places "If you are using the default analyzer, that's expected".  
My question is how to make a property not analyzed then ? I could not find a working example. I use elasticsearch v5.5.0. Can you provide me with an example of the mapping where only one property of a document is not analyzed please? Thanks in advance.

---

<div class="post-metadata">

**Author:** ![dbrezoev](https://avatars.discourse-cdn.com/v4/letter/d/8baadc/32.png) [@dbrezoev](https://discuss.elastic.co/u/dbrezoev)\
**Post date:** [August 31, 2017, 1:50pm UTC](https://discuss.elastic.co/t/regexp-not-matching-special-chars/98187/2 "2017-08-31T13:50:50Z")

</div>

Anyone?

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [August 31, 2017, 2:04pm UTC](https://discuss.elastic.co/t/regexp-not-matching-special-chars/98187/3 "2017-08-31T14:04:25Z")

</div>

Map the field as a [keyword datatype](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/keyword.html).

---

<div class="post-metadata">

**Author:** ![dbrezoev](https://avatars.discourse-cdn.com/v4/letter/d/8baadc/32.png) [@dbrezoev](https://discuss.elastic.co/u/dbrezoev)\
**Post date:** [August 31, 2017, 2:40pm UTC](https://discuss.elastic.co/t/regexp-not-matching-special-chars/98187/4 "2017-08-31T14:40:23Z")

</div>

Thanks Christian,

it works.

---

<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:** [September 28, 2017, 2:41pm UTC](https://discuss.elastic.co/t/regexp-not-matching-special-chars/98187/5 "2017-09-28T14:41:01Z")

</div>

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