官术网_书友最值得收藏!

  • Java 9 Regular Expressions
  • Anubhava Srivastava
  • 110字
  • 2021-07-02 18:58:36

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.

主站蜘蛛池模板: 昭觉县| 沾益县| 浮山县| 怀远县| 东港市| 晋中市| 崇左市| 铁岭县| 临泽县| 上饶县| 哈密市| 安仁县| 昌江| 永嘉县| 错那县| 英吉沙县| 当涂县| 云阳县| 萍乡市| 舒城县| 达拉特旗| 临江市| 安龙县| 临海市| 墨竹工卡县| 阜康市| 抚松县| 湛江市| 扎赉特旗| 纳雍县| 武乡县| 海林市| 新源县| 江源县| 清流县| 吉安县| 天气| 巴彦淖尔市| 古交市| 五台县| 丰镇市|