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

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

Examples of character classes

Which regex will match the letters p, m, or z?

Solution 1:

    [pmz]

Solution 2:

    [zmp]

Solution 3:

    [mzp]

All the preceding three regular expressions will behave in exactly the same manner because the order of the characters inside the character class does not matter.

Which regex will match English language vowels a, e, i, o, and u?

    [aeiou]

Which regex will match the field extensions .mp3 or .mp3?

    \.mp[34]

Which regex will match the letters @, #, or =?

[@#=]
主站蜘蛛池模板: 同仁县| 新晃| 大厂| 张北县| 乌恰县| 凉城县| 雷州市| 扶风县| 涞源县| 武平县| 剑川县| 邵阳市| 石台县| 江永县| 安西县| 河源市| 新乡市| 景泰县| 修武县| 靖边县| 乳山市| 娄底市| 龙州县| 新余市| 肃南| 安仁县| 五大连池市| 天柱县| 当阳市| 自贡市| 巴塘县| 陇川县| 松潘县| 肥城市| 安溪县| 芷江| 韶山市| 连南| 台东市| 余庆县| 勐海县|