How can I test for an increasing or decreasing number pattern in a string?
Assuming the string is just a number.
Ex:
var regexp = new RegExp(...) // something here
regexp.test("123456789") //true
regexp.test("121231234") //false
regexp.test("987654321") //true
regexp.test("5678901234") //true
The test would be for a cycle of digits really.
How could this be achieved?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…