Displaying page
of
pages;
Items to
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
of
pages;
Items to