Which of the following symbols are used for matching a pattern at specified locations?

Lan Anh

New member
Which of the following symbols are used for matching a pattern at specified locations?
A. *
B. ^
C. $
D. ^ and $
 
Answer: d
Explanation: Most of the regular expression character are used for matching patterns, but there are two symbols that are used for matching pattern at beginning or end of a line. These symbols are ^ and $.
Code:
^     - for matching at the beginning of a line
$     - for matching at the end of line
 

Tìm kiếm

Back
Top