RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Expressions by User

   Displaying page 1 of 1 pages; Items 1 to 1
Title Test Details Microsoft Printing Number ranges validation
Expression
[^\d^\-^\,^\x20]+
Description
Just a beginner....here's something I'm using to emulate the Microsoft "Print" functionality, where you can enter page numbers to print seperated by commas or specify a range using the "-" symbol. The expression checks across a whole string looking for anything that is NOT equal to a number, a minus symbol, a comma and a space character. You can use this expression to do a quick true-false check to see if the user has entered a valid string / page numbers. Later you could then write a routine to sort and / or process the input. Nothing fancy but might help someone. Comments welcome.
Matches
abcABC ! *$%&/()
Non-Matches
123456789 ,-
Author Rating: Not yet rated. Andrew McDuff
   Displaying page 1 of 1 pages; Items 1 to 1

Copyright © 2001-2025, RegexAdvice.com | ASP.NET Tutorials