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. Excluding Specific Characters

Excluding Specific Characters

Problem
Submissions
Leaderboard
Discussions
Editorial
  1. Prepare
  2. Regex
  3. Character Class
  4. Excluding Specific Characters
Exit Full Screen View
  • Problem
  • Submissions
  • Leaderboard
  • Discussions
  • Editorial

The negated character class [^] matches any character that is not in the square brackets.

Task

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

  • must be of length 6.
  • First character should not be a digit ( or ).
  • Second character should not be a lowercase vowel ( or ).
  • Third character should not be b, c, D or F.
  • Fourth character should not be a whitespace character ( \r, \n, \t, \f or <space> ).
  • Fifth character should not be a uppercase vowel ( or ).
  • Sixth character should not be a . or , symbol.

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 (_________).

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