We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
  • Hackerrank Home
  • Prepare
    NEW
  • Certify
  • Compete
  • Career Fair
  • Hiring developers?
  1. Prepare
  2. Regex
  3. Introduction
  4. Matching Whitespace & Non-Whitespace Character

Matching Whitespace & Non-Whitespace Character

Problem
Submissions
Leaderboard
Discussions
Editorial
  1. Prepare
  2. Regex
  3. Introduction
  4. Matching Whitespace & Non-Whitespace Character
Exit Full Screen View
  • Problem
  • Submissions
  • Leaderboard
  • Discussions
  • Editorial

\s matches any whitespace character [ \r\n\t\f ].


\S matches any non-white space character.

Task

You have a test string . Your task is to match the pattern
Here, denotes whitespace characters, and denotes non-white space characters.

Note

This is a regex only challenge. You are not required to write code.
You have to fill the regex pattern in the blank (_________).

  • Blog
  • Scoring
  • Environment
  • FAQ
  • About Us
  • Support
  • Careers
  • Terms Of Service
  • Privacy Policy
  • Request a Feature