# Regex question on dsl

**URL:** <https://discuss.elastic.co/t/regex-question-on-dsl/254998>\
**Category:** Elasticsearch\
**Created:** [November 11, 2020, 2:52am UTC](https://discuss.elastic.co/t/regex-question-on-dsl/254998 "2020-11-11T02:52:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lusynda](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lusynda/32/53557_2.png) [@lusynda](https://discuss.elastic.co/u/lusynda)\
**Post date:** [November 11, 2020, 2:52am UTC](https://discuss.elastic.co/t/regex-question-on-dsl/254998/1 "2020-11-11T02:52:36Z")

</div>

Hi all  
The regex on the search api have some limitation that i need to overcome somehow so please help me.  
i would like to search for something like this:  
test123.test[.]com  
something.test[.]com

now the regex that i use are ([a-z]?[1-9]?)_[.]test[.]com[and also i have tried to use this ._[.]test[.]com

it only match the something.test[.]com and not the test123.test[.]com  
and i have read the doc, the \<\> operator does not really seem to help either since i need to match the random number character behind so i dont really have a pattern for the number that may appear.

Please help me. Thanks you for your time.

---

<div class="post-metadata">

**Author:** ![lusynda](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lusynda/32/53557_2.png) [@lusynda](https://discuss.elastic.co/u/lusynda)\
**Post date:** [November 11, 2020, 3:23am UTC](https://discuss.elastic.co/t/regex-question-on-dsl/254998/2 "2020-11-11T03:23:45Z")

</div>

After some testing i realize that if only the number follow the . character then the regex will not match at all.

---

<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:23am UTC](https://discuss.elastic.co/t/regex-question-on-dsl/254998/3 "2020-12-09T03:23:47Z")

</div>

Closed on December 9, 2020, 3:23am UTC

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