Got more questions? Find advice on: ASP | SQL | XML | Windows
Welcome to RegexAdvice Sign in | Join | Help

Ascending numbers with specific separators

  •  02-08-2008, 10:24 AM

    Ascending numbers with specific separators

    Hello all,

    I'd like to check on a php page that a text string complies with the following rule : Contain numbers,  in ascending order, with only   ,    or    -     as separators

    The numbers represent requested items (like pages to print), my purpose is then to count the number of item requested.

     1,3,5-6 : Match (4 items)

    1,5,10-12,15,25-30,55 : Match (13 items)

    1,5-4,7 : No Match (not ascending order)

    Any other caracter but 0123456789,-   no match

     

    Thanks.

     

View Complete Thread