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. Character Class
  4. Matching Specific Characters

Matching Specific Characters

Problem
Submissions
Leaderboard
Discussions
Editorial

The character class [ ] matches only one out of several characters placed inside the square brackets.

Task

You have a test string .
Your task is to write a regex that will match with following conditions:

  • must be of length: 6
  • First character: 1, 2 or 3
  • Second character: 1, 2 or 0
  • Third character: x, s or 0
  • Fourth character: 3, 0 , A or a
  • Fifth character: x, s or u
  • Sixth character: . or ,

Note

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

Author

[deleted]

Difficulty

Easy

Max Score

10

Submitted By

44559

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