# Transfer json pattern capture filter configuration to yaml format, regex pattern not work?

**URL:** <https://discuss.elastic.co/t/transfer-json-pattern-capture-filter-configuration-to-yaml-format-regex-pattern-not-work/15380>\
**Category:** Elasticsearch\
**Created:** [January 23, 2014, 2:41pm UTC](https://discuss.elastic.co/t/transfer-json-pattern-capture-filter-configuration-to-yaml-format-regex-pattern-not-work/15380 "2014-01-23T14:41:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lord\_Artois](https://avatars.discourse-cdn.com/v4/letter/l/7ea924/32.png) [@Lord\_Artois](https://discuss.elastic.co/u/Lord_Artois)\
**Post date:** [January 23, 2014, 2:41pm UTC](https://discuss.elastic.co/t/transfer-json-pattern-capture-filter-configuration-to-yaml-format-regex-pattern-not-work/15380/1 "2014-01-23T14:41:23Z")

</div>

Hello, wonder anyone here could help

I was transfering this json to a yml format to include in the yml config  
file, but the patterns always cause a parse exception.

{  
"settings" : {  
"analysis" : {  
"filter" : {  
"code" : {  
"type" : "pattern\_capture",  
"preserve\_original" : 1,  
"patterns" : [  
"(([a-z]+)(\d\*))"  
]  
}  
},  
"analyzer" : {  
"code" : {  
"tokenizer" : "pattern",  
"filter" : ["code", "lowercase"]  
}  
}  
}  
}  
}

```
  code:
      type: pattern_capture
      preserve_original: false
      patterns: [/(([a-z]+)(\d*))/]

```

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/3bc3a9c1-de1a-48ab-a026-5cddf303ef5b%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/3bc3a9c1-de1a-48ab-a026-5cddf303ef5b%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [January 23, 2014, 3:06pm UTC](https://discuss.elastic.co/t/transfer-json-pattern-capture-filter-configuration-to-yaml-format-regex-pattern-not-work/15380/2 "2014-01-23T15:06:16Z")

</div>

May be you could try to use patterns: "[/(([a-z]+)(\d\*))/]"

Not tested though.

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 23 janv. 2014 à 15:41, Lord Artois [duketristan@gmail.com](mailto:duketristan@gmail.com) a écrit :

> Hello, wonder anyone here could help
> 
> ## I was transfering this json to a yml format to include in the yml config file, but the patterns always cause a parse exception. { "settings" : { "analysis" : { "filter" : { "code" : { "type" : "pattern\_capture", "preserve\_original" : 1, "patterns" : ["(([a-z]+)(\d\*))" ] } }, "analyzer" : { "code" : { "tokenizer" : "pattern", "filter" : ["code", "lowercase"] } } } } } code: type: pattern\_capture preserve\_original: false patterns: [/(([a-z]+)(\d\*))/]
> 
> You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/3bc3a9c1-de1a-48ab-a026-5cddf303ef5b%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/3bc3a9c1-de1a-48ab-a026-5cddf303ef5b%40googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/5242D449-D3AF-4351-9C11-E4FFF274915D%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/5242D449-D3AF-4351-9C11-E4FFF274915D%40pilato.fr).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Lord\_Artois](https://avatars.discourse-cdn.com/v4/letter/l/7ea924/32.png) [@Lord\_Artois](https://discuss.elastic.co/u/Lord_Artois)\
**Post date:** [January 23, 2014, 3:21pm UTC](https://discuss.elastic.co/t/transfer-json-pattern-capture-filter-configuration-to-yaml-format-regex-pattern-not-work/15380/3 "2014-01-23T15:21:19Z")

</div>

Thank you, it looks like this feature is in version 0.90.3, mine is 0.90.2

On Thursday, January 23, 2014 11:06:16 PM UTC+8, David Pilato wrote:

> May be you could try to use patterns: "[/(([a-z]+)(\d\*))/]"
> 
> Not tested though.
> 
> --  
> David 😉  
> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> 
> Le 23 janv. 2014 à 15:41, Lord Artois \<[duket...@gmail.com](mailto:duket...@gmail.com) \<javascript:\>\>  
> a écrit :
> 
> Hello, wonder anyone here could help
> 
> I was transfering this json to a yml format to include in the yml config  
> file, but the patterns always cause a parse exception.
> 
> {  
> "settings" : {  
> "analysis" : {  
> "filter" : {  
> "code" : {  
> "type" : "pattern\_capture",  
> "preserve\_original" : 1,  
> "patterns" : [  
> "(([a-z]+)(\d\*))"  
> ]  
> }  
> },  
> "analyzer" : {  
> "code" : {  
> "tokenizer" : "pattern",  
> "filter" : ["code", "lowercase"]  
> }  
> }  
> }  
> }  
> }
> 
> ```
> code:
> type: pattern_capture
> preserve_original: false
> patterns: [/(([a-z]+)(\d*))/]
> 
> ```
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/3bc3a9c1-de1a-48ab-a026-5cddf303ef5b%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/3bc3a9c1-de1a-48ab-a026-5cddf303ef5b%40googlegroups.com)  
> .  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/4faa1e1e-8bef-4b3b-b87c-24cc93f8786c%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/4faa1e1e-8bef-4b3b-b87c-24cc93f8786c%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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 6, 2017, 1:55am UTC](https://discuss.elastic.co/t/transfer-json-pattern-capture-filter-configuration-to-yaml-format-regex-pattern-not-work/15380/4 "2017-07-06T01:55:08Z")

</div>

Closed on July 6, 2017, 1:55am UTC


