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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find 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
Source My own
Your Rating
Bad Good

Enter New Comment

Title

Name

Comment

Spammers suck - we apologize. Please enter the text shown below to enable your comment (not case sensitive - try as many times as you need to if the first ones are too hard):

Existing User Comments

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