hi there,
i have been asking this question every time.

public bool ValidateTelNo(string TelNo)
        {
            bool value = false;

            
                string rePhoneNumber = @"[1-9]\d{2}\s?\d{3}\d{4}$";
                string PhoneNoFormat = @"\([1-9]\d{2}\)\s?\d{3}\-\d{4}$";

                Regex re = new Regex(rePhoneNumber);
                Regex re1 = new Regex(PhoneNoFormat);

                if (re.IsMatch(TelNo) || (re1.IsMatch(TelNo)))
                    value = true;

                else
                    value = false;

           

            return value;
        }

in the above code can someone explain rePhoneNumber and PhoneNoFormat ?
what are the valeus that it takes in and what charaters (int string or special)

appriciate
thankx

Recommended Answers

All 4 Replies

If you really, really need this stuff I can only advice you to study things you find on the net. Give you one more example: http://www.regexlab.com/en/regref.htm

Is this you buddy! - http://www.daniweb.com/forums/thread334504.html

i have been asking this question every time.

Asking same question multiple time is against the forum rules. Please tell us how this question is different than previous one.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.