Newline in regular expression validation...
-
I have a fancy asp:RegularExpressionValidator with this ValidationExpression: "^([0-9a-zA-Z _+-.*()&#%':!])+$" How do I change it so newlines are allowed in the associated multiline textbox? I have tried adding "\n" here and there, but it still doesn't work :( Guess newline is called something else or that I'm adding it in a wrong place. Thanks.
-
I have a fancy asp:RegularExpressionValidator with this ValidationExpression: "^([0-9a-zA-Z _+-.*()&#%':!])+$" How do I change it so newlines are allowed in the associated multiline textbox? I have tried adding "\n" here and there, but it still doesn't work :( Guess newline is called something else or that I'm adding it in a wrong place. Thanks.
hi check following url. tht may b helps to u.
[](http://msdn2.microsoft.com/en-us/library/ms972966.aspx#regexnet_topic9)[http://msdn2.microsoft.com/en-us/library/ms972966.aspx#regexnet_topic9](http://msdn2.microsoft.com/en-us/library/ms972966.aspx#regexnet_topic9)[[^](http://msdn2.microsoft.com/en-us/library/ms972966.aspx#regexnet_topic9 "New Window")]
:)Deepak Smile a Lots,Its Costs Nothing
-
hi check following url. tht may b helps to u.
[](http://msdn2.microsoft.com/en-us/library/ms972966.aspx#regexnet_topic9)[http://msdn2.microsoft.com/en-us/library/ms972966.aspx#regexnet_topic9](http://msdn2.microsoft.com/en-us/library/ms972966.aspx#regexnet_topic9)[[^](http://msdn2.microsoft.com/en-us/library/ms972966.aspx#regexnet_topic9 "New Window")]
:)Deepak Smile a Lots,Its Costs Nothing
Thanks, but I have already found that page myself. That's where I learned newline was to be written as "\n".
-
I have a fancy asp:RegularExpressionValidator with this ValidationExpression: "^([0-9a-zA-Z _+-.*()&#%':!])+$" How do I change it so newlines are allowed in the associated multiline textbox? I have tried adding "\n" here and there, but it still doesn't work :( Guess newline is called something else or that I'm adding it in a wrong place. Thanks.
-
have you tried to remove the "^" and "$" characters?these specify the beginning("^") and the end("$") of a line.so it makes no sense if "\n" is placed between these two. walter
I have tried the following (all unsuccessful): ^([0-9a-zA-Z _+-.*()&#%':!])+$\n ^([0-9a-zA-Z _+-.*()&#%':!])\n+$ ([0-9a-zA-Z _+-.*()&#%':!])+\n ([0-9a-zA-Z _+-.*()&#%':!])\n+ ^([0-9a-zA-Z _+-.*()&#%':!])\r\n+$ ^([0-9a-zA-Z _+-.*()&#%':!])+\r\n$ ([0-9a-zA-Z _+-.*()&#%':!])+\r\n ([0-9a-zA-Z _+-.*()&#%':!])\r\n+
-
I have tried the following (all unsuccessful): ^([0-9a-zA-Z _+-.*()&#%':!])+$\n ^([0-9a-zA-Z _+-.*()&#%':!])\n+$ ([0-9a-zA-Z _+-.*()&#%':!])+\n ([0-9a-zA-Z _+-.*()&#%':!])\n+ ^([0-9a-zA-Z _+-.*()&#%':!])\r\n+$ ^([0-9a-zA-Z _+-.*()&#%':!])+\r\n$ ([0-9a-zA-Z _+-.*()&#%':!])+\r\n ([0-9a-zA-Z _+-.*()&#%':!])\r\n+
-
what exactly do you want to validate? give me an example of the validated text and the rules you want to apply walter
I want to validate something like this: -------- BBC Health, Article #6180753: Important!! Vegetarians were more likely to be female, to be of higher occupational social class and to have higher academic or vocational qualifications than non-vegetarians. However, these differences were not reflected in their annual income, which was similar to that of non-vegetarians. Lead researcher Catharine Gale said: "The finding that children with greater intelligence are more likely to report being vegetarian as adults, together with the evidence on the potential benefits of a vegetarian diet on heart health, may help to explain why higher IQ in childhood or adolescence is linked with a reduced risk of coronary heart disease in adult life." --------
-
I want to validate something like this: -------- BBC Health, Article #6180753: Important!! Vegetarians were more likely to be female, to be of higher occupational social class and to have higher academic or vocational qualifications than non-vegetarians. However, these differences were not reflected in their annual income, which was similar to that of non-vegetarians. Lead researcher Catharine Gale said: "The finding that children with greater intelligence are more likely to report being vegetarian as adults, together with the evidence on the potential benefits of a vegetarian diet on heart health, may help to explain why higher IQ in childhood or adolescence is linked with a reduced risk of coronary heart disease in adult life." --------
-
It helped half of the way :) It now passes client side, but fails server side. this.IsValid returns false server side...
-
It helped half of the way :) It now passes client side, but fails server side. this.IsValid returns false server side...
-
well...;) there's probably a problem with the view-state in your site, i don't know. maybe you'll find these links helpful: RegExLib[^] and RegEx-Coach[^] for testing your regular expressions. good luck walter
Great links, thanks. Now it works perfectly in Firefox, but it fails clientside in bloody Explorer... I'm using: ([0-9a-zA-Z _\+-\.\*\(\)&#%':!\n"])+ RegEx-Coach say everything is fine about the expression.