actually i am using it at internal application which generate a xml, whose code is written in java. But here at application if ^(249)?1\d{8}$ then it forward to next operation, if number not above then give user wrong input i.e. I am not directly interact to java codeI want a regex for mobile number validation. The regex pattern should be such that it must accept 249 country code(only once) followed by '1' (only once) followed by 8 digit. Country code should be optional.If country code doesn't exist, it should accept only 9 digit number which started with 1. actually i am using it at internal application