# How to check regex is valid or not?

**URL:** <https://discuss.elastic.co/t/how-to-check-regex-is-valid-or-not/38854>\
**Category:** Elasticsearch\
**Created:** [January 11, 2016, 9:14am UTC](https://discuss.elastic.co/t/how-to-check-regex-is-valid-or-not/38854 "2016-01-11T09:14:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vrkansagara](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vrkansagara/32/6804_2.png) [@vrkansagara](https://discuss.elastic.co/u/vrkansagara)\
**Post date:** [January 11, 2016, 9:14am UTC](https://discuss.elastic.co/t/how-to-check-regex-is-valid-or-not/38854/1 "2016-01-11T09:14:28Z")

</div>

Hello

I want to check weather the regex is valid or not using search api and valid api validator.

Can any body help me out that how can I achieve this.

Query type can be : match all , match and some time wildcard.

Tried following things  
`{ "regexp":{ "columnName": { "value": "\/([A-Z])\\w+\/g", "flags" : "INTERSECTION|COMPLEMENT|EMPTY", "max_determinized_states": 20000 } } }`

Thanks.

---

<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:25pm UTC](https://discuss.elastic.co/t/how-to-check-regex-is-valid-or-not/38854/2 "2017-07-05T23:25:28Z")

</div>


