# Filter query to select only pure alphanumeric value but not numeric value

**URL:** <https://discuss.elastic.co/t/filter-query-to-select-only-pure-alphanumeric-value-but-not-numeric-value/261931>\
**Category:** Elasticsearch\
**Created:** [January 22, 2021, 3:19pm UTC](https://discuss.elastic.co/t/filter-query-to-select-only-pure-alphanumeric-value-but-not-numeric-value/261931 "2021-01-22T15:19:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vivek\_Vardhan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vivek_vardhan/32/49429_2.png) [@Vivek\_Vardhan](https://discuss.elastic.co/u/Vivek_Vardhan)\
**Post date:** [January 22, 2021, 3:19pm UTC](https://discuss.elastic.co/t/filter-query-to-select-only-pure-alphanumeric-value-but-not-numeric-value/261931/1 "2021-01-22T15:19:50Z")

</div>

I have a field defined in ES as

> ```
> "fieldName": {
> "type": "text",
> "fields": {
> "keyword": {
> "type": "keyword"
> }
> }
> },
> 
> ```

Its a text field, which values can be numeric or alphanumeric. I want to delete all the documents which are alphanumeric but not numeric. How can I achieve it?

below Regexp did not work

> {  
> "query": {  
> "bool": {  
> "filter": {  
> "regexp": {  
> "fieldName": {  
> "value": "/^(?![0-9]\*$)[a-zA-Z0-9]+$/",  
> "boost": 1.2  
> }  
> }  
> }  
> }  
> }  
> }

---

<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:** [February 19, 2021, 3:19pm UTC](https://discuss.elastic.co/t/filter-query-to-select-only-pure-alphanumeric-value-but-not-numeric-value/261931/2 "2021-02-19T15:19:51Z")

</div>

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