|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi,
I'm trying to get a regular expression to validate user input. The expression should prevent the use of empty string's or non-digit's. At the moment I'm using Regex,IsMatch(input, @"(^)|(\D)") but this does not work. On their own they appear to work fine, but I would like to combine them into one check. Is this possible? Mark |
|
#2
|
||||
|
||||
|
Code:
IsMatch(input, @"(\D)") You don't need to check if nothing is there, it'll fail if it doesn't match a digit i.e it's blank. If it doesn't work let me know.
__________________
Miscellaneous Software Viper_SB Developershed E-Support Anyone else play chess? Challenge me |
|
#3
|
|||
|
|||
|
Viper,
Many thanks for your reply. As always best to keep things simple - working a treat. Mark Quote:
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > .Net Development > Regular Expression Problem |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|