go to previous page   go to home page   go to next page

([a-d]{5})+

Answer:

It matches one or more groups of five characters, where each group consists only of the characters 'a' through 'd'.

It does match:

aaaaa     aaaaabbbbb     abcdaddcca

It does not match:

aa     aaaaab     aaaaabbaaaaa

Between n and m Times: {n,m}

Regular Expression
(Delimit with quotes)
String
(Delimit with quotes)

The subexpression X{n,m} means to match at least n but no more than m, of the subexpression X. The numbers n and m must be literal constants, like 5, or 0, or 23. Of course, n must be less than m. For example

[a-d]{2,7}

means to match between two and seven (inclusive) characters, where the characters are selected from 'a' through 'd'. The following strings match:

aa     aaaaaaa     abc     addbcc

These strings do not match:

a     abcdabcd     axaaa

QUESTION 18:

Describe the strings matched by the following

[ABC]{2,4}[XYZ]{2,4}