Character Class
Last updated
Last updated
You have a test string S. Your task is to write a regex that will match S with following conditions:
S 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 ,
You have a test string S. Your task is to write a regex that will match S with the following conditions:
S must be of length 6
.
First character should not be a digit
(1, 2, 3, 4, 5, 6, 7, 8, 9 or 0).
Second character should not be a lowercase vowel
(a, e, i, o or u).
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
(A, E, I, O or U).
Sixth character should not be a .
or ,
symbol.
Write a RegEx that will match a string satisfying the following conditions:
The string’s length is >= 5.
The first character must be a lowercase English alphabetic character.
The second character must be a positive digit. Note that we consider zero to be neither positive nor negative.
The third character must not be a lowercase English alphabetic character.
The fourth character must not be an uppercase English alphabetic character.
The fifth character must be an uppercase English alphabetic character.