Home » JAVA Programming » Regular Expressions » Question
  1. Which of the following matches nonword character using regular expression in java?
    1. \s
    2. \S
    3. \W
    4. \w
    5. None of these
Correct Option: C

\W matches nonword characters. [0-9], [A-Z] and _ (underscore) are word characters. All other than these characters are nonword characters.



Your comments will be displayed only after manual approval.