# Regex on a string field with number

**URL:** https://discuss.elastic.co/t/regex-on-a-string-field-with-number/254667
**Category:** Kibana
**Created:** [November 8, 2020, 12:14pm UTC](https://discuss.elastic.co/t/regex-on-a-string-field-with-number/254667 "2020-11-08T12:14:57Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![sudersank](https://avatars.discourse-cdn.com/v4/letter/s/258eb7/32.png) [@sudersank](https://discuss.elastic.co/u/sudersank)
#### Post date: [November 8, 2020, 12:14pm UTC](https://discuss.elastic.co/t/regex-on-a-string-field-with-number/254667/1 "2020-11-08T12:14:57Z")

</div>

I have a timestamp field which will have value as below  
log\_timestamp : 11/8/2020#17:21:25:635

The log\_timestamp is a string field. How do i use regex to filter values from

11/8/2020#17:21:22:635 To 11/8/2020#17:21:25:635

I tried with \<2-5\> on that particular character but it isnt working

Any help or direction would be of great help

---

<div class="post-metadata">

### Author: ![wylie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wylie/32/81794_2.png) [@wylie](https://discuss.elastic.co/u/wylie)
#### Post date: [November 11, 2020, 3:41pm UTC](https://discuss.elastic.co/t/regex-on-a-string-field-with-number/254667/2 "2020-11-11T15:41:32Z")

</div>

Is there a reason you've parsed it as a string field, instead of a date field? I think it would be easier to handle this using date ranges. [https://www.elastic.co/guide/en/elasticsearch/reference/current/date.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/date.html)

If you still want help with your regular expression, you will need to be more specific about what you've already tried. It's impossible to help with a regex unless we see the actual regex and some examples

---

<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: [December 9, 2020, 3:41pm UTC](https://discuss.elastic.co/t/regex-on-a-string-field-with-number/254667/3 "2020-12-09T15:41:34Z")

</div>

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