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 2
Title Test Details Number Validation
Expression
(?!^([0-9]+[-]?[0-9]+)$)(?!^([0-9]+[[\\s]*]?[0-9]+)$)^([0-9]+\.?[0-9]+$|(^[-]?[0-9]+([[\\s]*]?)$)|^([-]?)[0-9]+\.?[0-9]+([[\\s]*]?)|([0-9]+))$
Description
I have worked on this regular expression to get valid numbers from users. Its really simple, but yes required alot of my time and attention to make it work perfectly. It was my very first creation of regular expression.
Matches
-3, -3.3, 3, 3.3
Non-Matches
3. , 3. 3, -, -., spaces
Author Rating: Not yet rated. Saqib Rasheed
Title Test Details UserId
Expression
(?!^([0-9]+)([[\\s]*]?)$)(?!^([0-9]+)[[a-zA-Z]*]?([[\\s]*]?)$)^([_]?([a-zA-Z0-9]+)([[\\s]*]?))$
Description
This regular expression validates for a user id. The expression was built by keeping the rules of defining a variable in c++.
Matches
_x, _x2, _123, _123x, xyz
Non-Matches
123, 123x, spaces, special chars
Author Rating: Not yet rated. Saqib Rasheed
   Displaying page 1 of 1 pages; Items 1 to 2

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