hi all, Can anybody please tell me how do we use a regular expression to validate when a field starts with any of the given strings say "abc","xyz","ghi" i have tried this in validation.xml <var-name>mask</var-name> <var-value>^[^(abc)|(xyz)|(ghi)]]</var-value> but this did not work
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35241
7
posted
0
Not sure about how to use it in Struts, but this regexp seems better:
^(abc|xyz|ghi)
As an aside, "this did not work" is a rather deficient description of a problem. How did it not work - was the validation used, but the regexp didn't capture what you thought it would capture? Or was the validation never used? Or something else? [ February 22, 2006: Message edited by: Ulf Dittmer ]
with did not work i meant that the validation did not work as expected i mean its checking for string that starts with any of the letters or combination of letters in the list ie a b c x y z g h i seperately,sorry for not making it clear earlier. i have tried with the regular expression which u have suggested but this doesnot work as expected as well