Java Character Class Regular Expression. We use lots of special characters and metacharacters with regular expressions in java. The regex package consists of the classes, which are used for matching character sequences against regular expressions in the specified pattern.
(a) \w (b) \w (c) \s (d) \s the question was asked during an interview. Java regular expression character class regex. In this section, we will provide the tables containing character classes, meta characters, and quantifiers that can be used with regex.