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

    HackerRank

  • |
  • Prepare
  • Certify
  • Compete
  • Hiring developers?
  1. Prepare
  2. Regex
  3. Introduction
  4. Matching Digits & Non-Digit Characters

Matching Digits & Non-Digit Characters

Problem
Submissions
Leaderboard
Discussions
Editorial

The expression \d matches any digit [ - ].


The expression \D matches any character that is not a digit.

Task

You have a test string . Your task is to match the pattern
Here denotes a digit character, and denotes a non-digit character.

Note

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

Author

[deleted]

Difficulty

Easy

Max Score

5

Submitted By

77773

Need Help?


View discussions
View editorial
View top submissions

rate this challenge

MORE DETAILS

Download problem statement
Download sample test cases
Suggest Edits
  • Blog
  • Scoring
  • Environment
  • FAQ
  • About Us
  • Support
  • Careers
  • Terms Of Service
  • Privacy Policy