Jump to the post that solved this thread.
Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Find pattern for series from 1287 to 9834
#3
Solved: 8 Years, 9 Months ago
This regex has many flaws.
for eg: 1900 is not getting matched which is withing the range.

these types of conditions are best if handled in code than by regex.
Anyways...the regex for this specific condition is as below:

Code:
(?(^128[7-9]{1}$)(128[7-9])
|(?(^12[8-9]\d$)(12[8-9]\d)
|(?(^1[2-9]\d{2}$)(1[2-9]\d{2})
  |(?(^[2-8]\d{3}$)([2-9]\d{3})
   |(?(^983[0-4]$)(983[0-4])
    |(?(^98[0-3]\d$)(98[0-3]\d)
     |(?(^9[0-8]\d{2}$)(9[0-8]\d{2})
      )
     )
    )
   )
  )
)
)
Reply
Jump to the post that solved this thread.


Messages In This Thread
RE: Find pattern for series from 1287 to 9834 - by akhi_s27 - 07-29-2015, 10:52 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)