Characters classes specifies a list of possible characters : Basic Regular Expressions « Regular Expressions « Java






Characters classes specifies a list of possible characters

   

Character Class Meta-Character            Matches

.                                         Any single character

\d                                        A digit [0-9]

\D                                        A nondigit [^0-9]

\s                                        A whitespace character [ \t\n\x0B\f\r]

\S                                        A nonwhitespace character[^\s]

\w                                        A word character  [a-zA-Z_0-9]

\W                                        A nonword character [^\w] 

   
    
  








Related examples in the same category

1.Meta-characters to match against certain string boundaries
2.POSIX character classes and Java character classes
3.Character Class Matches
4.Greedy Operator Description
5.Reluctant (Lazy) Operator Description
6.Displays directory listing using regular expressionsDisplays directory listing using regular expressions
7.Like Regular Expression Demo in a TextFieldLike Regular Expression Demo in a TextField
8.StringConvenience -- demonstrate java.lang.String convenience routineStringConvenience -- demonstrate java.lang.String convenience routine
9.Split a String into a Java Array of Strings divided by an Regular ExpressionsSplit a String into a Java Array of Strings divided by an Regular Expressions
10.Simple example of using Regular Expressions class.Simple example of using Regular Expressions class.
11.Match the Q[^u] pattern against strings from command line
12.demonstrate Regular Expressions: Match -> group()demonstrate Regular Expressions: Match -> group()
13.Show case control using Regular Expressions class.Show case control using Regular Expressions class.
14.Matcher and Pattern demoMatcher and Pattern demo
15.Matcher and Pattern demo 2Matcher and Pattern demo 2
16.Standalone Swing GUI application for demonstrating Regular expressions.Standalone Swing GUI application for demonstrating Regular expressions.
17.Regular Expressions in Action
18.Match SQL string
19.Display all URLs in a web page by matching a regular expression that describes the HTML tag