Examples of character range

The following is a regex that matches any uppercase or lowercase alphabet in the English language:

    [a-zA-Z] 

The a-z pattern is for the lowercase character range and A-Z is for the uppercase character range.

The following regex matches any alphanumeric characters:

    [a-zA-Z0-9] 

Alpha numeric characters consist of any English alphabets and digits.

The following regex matches any hexadecimal character:

    [a-fA-F0-9] 

We know that hexadecimal characters consist of digits, 0 to 9, and letters, A to F (ignore casing). The preceding regex pattern shows a character class that includes these two character ranges. We use a-f and A-F ranges to make it match uppercase or lowercase letters.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.217.175.182