# Pattern Replace Token Filter not working with "c++"

**URL:** https://discuss.elastic.co/t/pattern-replace-token-filter-not-working-with-c/31929
**Category:** Elasticsearch
**Created:** [October 9, 2015, 5:46pm UTC](https://discuss.elastic.co/t/pattern-replace-token-filter-not-working-with-c/31929 "2015-10-09T17:46:07Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![acv2](https://avatars.discourse-cdn.com/v4/letter/a/a4c791/32.png) [@acv2](https://discuss.elastic.co/u/acv2)
#### Post date: [October 9, 2015, 5:46pm UTC](https://discuss.elastic.co/t/pattern-replace-token-filter-not-working-with-c/31929/1 "2015-10-09T17:46:07Z")

</div>

im trying to test a replace "c++" with "cplusplus" which is sopposed to be easy thing... IT IS NOT haha  
what im doing is the following..  
"char\_filter": {  
"replace\_key\_words": {  
"type": "pattern\_replace",  
"pattern": "c\\+\\+",  
"replacement": "cplusplus"  
}  
}

it works if i set c@@ ... but as soon i try to use reserved character(+ or #) i doesn't work at all, maybe there is some hiden reason why this wouldnt work, hope you guys can help me with this mistery ^^

regards  
Daniel

---

<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 5, 2017, 11:45pm UTC](https://discuss.elastic.co/t/pattern-replace-token-filter-not-working-with-c/31929/2 "2017-07-05T23:45:37Z")

</div>


