Which of the following meanings can a $ character assume within a regular expression? (can have more than 1 answer)
a. A literal dollar sign
b. Shell variable syntax
c. End-of-line anchor for pattern matching
d. Match any single character

Respuesta :

Answer:

a. A literal dollar sign .

b. Shell variable syntax.

c. End-of-line anchor for pattern matching.

Explanation:

There are three answers to this question among the given options.

When a regular expression is quoted single, the $ character can act in one of two ways. end of line anchor for pattern matching.Elsewhere it acts as a literal dollar sign.

When a double quoted regular expression is there, the $ character is treated as a shell variable syntax.