Re: Valid regular expression not working with validator control

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hello Andrew,

Hi

thanks for the tip. I still can't get what I want to work. I'm using
Expresso to test.

Basically I want to make sure that if an input text includes a certain
domain then validation fails, e.g.

anyone@xxxxxxxxxxxxxxxxxxxxxx fails
anyone@xxxxxxxxxxxxxxxxxx succeeds
Please bear with me as I'm a complete novice with regular expressions.

^[^@]+@(?!not-allowed-domain.com$).*$

should do, though it doesn't check the syntax of the email address itself, it does exclude the domain you want.

Jesse



Thanks again
Andrew
"Jesse Houwing" <jesse.houwing@xxxxxxxxxxxxxxxx> wrote in message
news:21effc90464ad8ca4c739989114d@xxxxxxxxxxxxxxxxxxxxx

Hello Andrew,

Hi

I get a JavaScript error with this expression when using the
RegExpValidator. Also if I switch off client script the server side
code validator finds a match regardless of the entered string.

(?<!@emailaddressnotallowed\.org)$

Is there a way of writing this so it works with the validator in
both client side and server side?

Look behinds are not supported in Client Side code. So you need to
rewrite this to either a full expression or to use a look ahead like
this:

^regexuptothe@(?!emailaddressnotallowed\.org$)restofthedomainregex$

--
Jesse Houwing
jesse.houwing at sogeti.nl
--
Jesse Houwing
jesse.houwing at sogeti.nl


.



Relevant Pages

  • Re: Valid regular expression not working with validator control
    ... Also if I switch off client script the server side ... code validator finds a match regardless of the entered string. ... Is there a way of writing this so it works with the validator in both ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Validation and Firefox(js scripts doesnt fire)
    ... > Validator controls work very well on MSIE but not on other browsers? ... >> supplying content for mobile devices too. ... And how do you know that the information really was validated client side? ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Validating CheckBoxes on the ClientSide
    ... public class ValidifiableCheckBox: CheckBox ... If in the ServerValidate you access args.Value you will get the output of Wibble, however this doesn't change the client side functionality which always just returns "on". ... investigated the custom validator, however, when I try to get the "args.Value" in my clientside code I always get the value "on" regardless of state. ... Server validation is fine but AFAIK you have to provide client side validation code if you want to validate this client side. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Client Side validation and Post to method in CodeBehind Class
    ... If you use a CustomValidator control, you can check against the validator in ... both client and server script. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: controltovalidate property of customvalidator is incorrect
    ... client side validation runs, it validates the selected value of clientsigned ... note that my composite control is an inherited radioButtonList. ... DateBox is a Textbox that adds the validation controls i'm interested in, ... This is the the stuff asp.net rendered for the validator. ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)