I need a regex to mimic the "print pages" option you get int the print dialog box on windows. Each "page" must be exactly 3 digits long and can be a single page or a range of pages (I already have a check in place to ensure the range is valid).
Pages do not need to be in any order (except for ranges), and can be repeated.
Valid Entries
001,002,003-006
001-005,010,011-015,004
001,001,002-006,008-009,050,145
Invalid Entries
001, 002,003-006 (no spaces allowed)
001-5,010,011-015,004 (all pages must be three digits long)
001,001,002-006,008-009.050,145 (only numbers, (0-9), commas and dashes allowed
Can someone help?
--------
GOOGLE is a great resource to find answers to questions like "how do i..."
If you don't know exaclty what you want to do or what to search on, try Google Suggest: --------
I have recently been semi-converted to ensuring all my code (well most of it) works in both javascript and non-javasc
Pages do not need to be in any order (except for ranges), and can be repeated.
Valid Entries
001,002,003-006
001-005,010,011-015,004
001,001,002-006,008-009,050,145
Invalid Entries
001, 002,003-006 (no spaces allowed)
001-5,010,011-015,004 (all pages must be three digits long)
001,001,002-006,008-009.050,145 (only numbers, (0-9), commas and dashes allowed
Can someone help?
--------
GOOGLE is a great resource to find answers to questions like "how do i..."
If you don't know exaclty what you want to do or what to search on, try Google Suggest: --------
I have recently been semi-converted to ensuring all my code (well most of it) works in both javascript and non-javasc