nerdexam
Cisco

200-201 · Question #389

What matches the regular expression r(ege)+x?

The correct answer is B. regeegex. The regular expression r(ege)+x matches strings starting with 'r', followed by one or more occurrences of the 'ege' sequence, and ending with 'x'.

Submitted by katya_ua· Mar 6, 2026Security Concepts

Question

What matches the regular expression r(ege)+x?

Options

  • Ar(ege)x
  • Bregeegex
  • Crx
  • Drege+x

How the community answered

(31 responses)
  • B
    90% (28)
  • C
    6% (2)
  • D
    3% (1)

Why each option

The regular expression r(ege)+x matches strings starting with 'r', followed by one or more occurrences of the 'ege' sequence, and ending with 'x'.

Ar(ege)x

`r(ege)x`, if interpreted as a literal string pattern, only contains one 'ege' occurrence, not 'one or more' as specified by the `+` quantifier.

BregeegexCorrect

The regular expression `r(ege)+x` means: 'r' matches the literal character 'r'; `(ege)` matches the literal sequence 'ege'; `+` indicates that the preceding group (ege) must occur one or more times; and 'x' matches the literal character 'x'. Therefore, 'regeegex' fits because it has 'r', followed by 'ege' twice (which is one or more times), and ends with 'x'.

Crx

`rx` does not contain the 'ege' sequence at all, violating the `(ege)+` requirement.

Drege+x

`rege+x` would match 'r', followed by 'eg' and then one or more 'e's, ending with 'x', which is different from one or more occurrences of the entire 'ege' sequence.

Concept tested: Regular expression syntax - repetition (+)

Source: https://learn.microsoft.com/en-us/dotnet/standard/base-types/quantifiers-in-regular-expressions

Topics

#regular expressions#regex syntax#pattern matching

Community Discussion

No community discussion yet for this question.

Full 200-201 Practice