The regular expression should and does allow a custom serial number of this format: WA00000 or WC0000 or WT00000...thats outside of struts. The result when i run my form is that the field is always invalid when i enter valid values.... please help. Does the validator not recognize some regular expressions??

I'm not really sure that's a valid regex, either. I just tried online with several different regex testers and none of them do what I think you're asking it to. Is the regex supposed to accept A-Z except W, followed by A-Z except TAC, and 5 digits?

I'm not really sure that's a valid regex, either. I just tried online with several different regex testers and none of them do what I think you're asking it to. Is the regex supposed to accept A-Z except W, followed by A-Z except TAC, and 5 digits?

It's a valid one...i've tested it using two validator applications and it works fine, just not with struts validator. The [A-Z-[^W]] means accept only the letter W, you can read that A-Z Minus NOT W. The rule accepts serial numbers of the form WA00000 or WC00000 or WA0000, that's what I'm trying to achieve.

I'm not really sure that's a valid regex, either. I just tried online with several different regex testers and none of them do what I think you're asking it to. Is the regex supposed to accept A-Z except W, followed by A-Z except TAC, and 5 digits?

It's a valid one...i've tested it using two validator applications and it works fine, just not with struts validator. The [A-Z-[^W]] means accept only the letter W, you can read that A-Z Minus NOT W. The rule accepts serial numbers of the form WA00000 or WC00000 or WA0000, that's what I'm trying to achieve.

Thanks for the tip on online validators. When I check the expression using those it fails, i had downloaded two regex builders and they all agreed that the expression is valid..not the online ones though. Long story short if i avoid the MINUS and negation the expression works with the on line validators, i'm sure the struts validator wont have a prob either. Here is the new expression ^[W][ATC]\d\d\d\d\d$

I'm not really sure that's a valid regex, either. I just tried online with several different regex testers and none of them do what I think you're asking it to. Is the regex supposed to accept A-Z except W, followed by A-Z except TAC, and 5 digits?

It's a valid one...i've tested it using two validator applications and it works fine, just not with struts validator. The [A-Z-[^W]] means accept only the letter W, you can read that A-Z Minus NOT W. The rule accepts serial numbers of the form WA00000 or WC00000 or WA0000, that's what I'm trying to achieve.

Thanks for the tip on online validators. When I check the expression using those it fails, i had downloaded two regex builders and they all agreed that the expression is valid..not the online ones though. Long story short if i avoid the MINUS and negation the expression works with the on line validators, i'm sure the struts validator wont have a prob either. Here is the new expression ^[W][ATC]\d\d\d\d\d$

Thanks....

Mlati

Mlati

Hey I've tested the new regex on struts and it still won't validate.. any idea why? Does the validator not recognize some expressions?? This beats me, I have ^[W][ATC]\d\d\d\d\d$

Post the validation config again. You never answered whether or not that was a typo in the original one (or if you did answer, I missed it). The expression is correct and verified using the ORO demo page, so something else is wrong.

David Newton wrote:Post the validation config again. You never answered whether or not that was a typo in the original one (or if you did answer, I missed it). The expression is correct and verified using the ORO demo page, so something else is wrong.

I answered you, it was not a typo. Its a valid expression. Here is my config though. Thanks

No, the regex works fine on the ORO demo page. I suppose you could try escaping the backslash in case there's something funky going on with Java strings, but that seems very unlikely. Or including a "mask" msg in case that's required, but I didn't think it was.