views:

190

answers:

1

Hi all,

Rule: field must contain at least 2 non-space alphanumeric characters.

please any one can guide us how to write the regular expression

thanks in advance....

+2  A: 

Match one alphanumeric character followed by zero or more characters followed by another alphanumeric character:

\w.*\w

If the validation automatically adds ^ and $, you have to match the characters before and after also:

.*\w.*\w.*

The \w code matches A-Z, a-z, 0-9 and _. If you have a different definition for aplhanumeric characters, you can use a set of characters instead, for example:

[A-Za-z0-9].*[A-Za-z0-9]
Guffa
i am going to write regular expression in SQL server 2008...we developed the REGEX function in VS2008 and we deployed that in SQL.. so by passing Regular expression it will validate the input data....
VinnaKanna
oO We have almost identical answers) So I'd better delete mine.
Rorick