nerdexam
Cisco

350-501 · Question #91

Which regular expression query modifier function indicates the start of a string?

The correct answer is A. ^. In regular expressions, the caret '^' symbol is used as an anchor to match the beginning of a string.

Automation and Assurance

Question

Which regular expression query modifier function indicates the start of a string?

Options

  • A^
  • B[^]
  • C
  • D$

How the community answered

(18 responses)
  • A
    89% (16)
  • B
    6% (1)
  • C
    6% (1)

Why each option

In regular expressions, the caret '^' symbol is used as an anchor to match the beginning of a string.

A^Correct

The caret '^' symbol is a special character in regular expressions that asserts the position at the start of the string or the start of a line, depending on the regex engine's mode.

B[^]

`[^]` denotes a negated character set, meaning it matches any character that is NOT inside the brackets. It does not indicate the start of a string.

C+

The plus sign `+` is a quantifier that matches one or more occurrences of the preceding character or group. It does not indicate the start of a string.

D$

The dollar sign `$` is an anchor that matches the end of a string or the end of a line, not the start.

Concept tested: Regular expression anchors

Source: https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/12_4t/12_4t_book/ip_regexp.html

Topics

#Regular Expressions#String matching#Pattern matching#Regex metacharacters

Community Discussion

No community discussion yet for this question.

Full 350-501 Practice