serge calderara wrote:
Dear all,
I have a text box on which my user should enter a server name in the
form of "\\MyServer" . I have place on my form a
RequireFiledValidator and a RegularExpressionValidator.
What is the syntax of the Expression to check that the starting
charcter for the textbox is \\ ?
I have tryied "^\\\" but it is nor correct
thnaks for your help
regards
serge
You should escape both "\"'s, so you will end up with four of them : \\\\
I have the impression that the REvalidator acts as if it always prepends
a ^ and appends a $ to the RE, so the entire input must match the entire RE.
In this case you want to start with \\, but after that "anything" is possible.
Try "\\ \\ .*" (without the spaces, which were added for clarity).
You could also use "\\ \\ [a-zA-Z] [a-zA-Z0-9]*", to force at least one letter
and after that any number of letters and/or numbers - no other characters allowed.
Hans Kesting