What's a Regex pattern for 3 consecutive digits increasing or decreasing

后端 未结 3 1827
情话喂你
情话喂你 2020-12-19 12:59

I need a regex pattern to match a sequence of 3 consecutive digits in a string that are consecutively increasing or decreasing.

For example:

These strings sh

3条回答
  •  长情又很酷
    2020-12-19 13:36

    There is no other way than listing them:

    (012|123|234|345|456|567|678|789|987|876|765|654|543|432|321|210)
    

提交回复
热议问题