On May 24, 10:20 am, Anthony Lam <anthonycklamp...@hotmail.com> wrote: > Hi, > > I am seeking for the right syntax for formatting the phone number into the > required format (xxx)xxxxxx (example: (123)676666 for lab > 4210-struts-validator exercise. > > I tried ^\(?(\d{3})\)?(\d{6})$ as the formatting string, but the end result > is skipping either left and right bracket in the input still pass the > validation rule. > > Pls also advise where can I find the detailed explaination of the formatting > string syntax rule. Try to use [] groups instead of escaping and {n} outside of the group instead of inside of the group.
Michèle Michèle > > Thanks in advance. > > Regards, > > Anthony > > _________________________________________________________________ > Your E-mail and More On-the-Go. Get Windows Live Hotmail > Free.https://signup.live.com/signup.aspx?id=60969 > > -- > You received this message because you are subscribed to the Google > Groups "Java EE (J2EE) Programming with Passion!" group. > To post to this group, send email to > java-ee-j2ee-programming-with-passion@googlegroups.com > To unsubscribe from this group, send email to > java-ee-j2ee-programming-with-passion+unsubscr...@googlegroups.com > For more options, visit this group > athttp://groups.google.com/group/java-ee-j2ee-programming-with-passion?... -- You received this message because you are subscribed to the Google Groups "Java EE (J2EE) Programming with Passion!" group. To post to this group, send email to java-ee-j2ee-programming-with-passion@googlegroups.com To unsubscribe from this group, send email to java-ee-j2ee-programming-with-passion+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/java-ee-j2ee-programming-with-passion?hl=en?hl=en