pattern matching in elastic search?

前端 未结 2 1457
醉酒成梦
醉酒成梦 2021-01-23 07:53

Continuing from my earlier post, I have changed the query as according to femtoRgon\'s post some characters and anchors are not supported by elastic search.

I am looking

2条回答
  •  半阙折子戏
    2021-01-23 08:45

    You forget to add - before ? in your regex and also use anchors if necessary.

    "[0-9]{3}-?[0-9]{2}-?[0-9]{4}"
    

    OR

    "^[0-9]{3}-?[0-9]{2}-?[0-9]{4}$"
    

提交回复
热议问题