Basics of Regular Expressions Flashcards
1
Q
How are regular expressions typically enclosed in programming languages?
A
within forward slashes (/) to define them as regular expression literals; may vary depending on the language and context
2
Q
Why are single or double quotes used when using regular expressions in shell?
A
to prevent the shell from interpreting special characters within the regular expression
3
Q
What is a literal?
A
value that is represented exactly as it appears, without any special interpretation or modification
4
Q
What is used to indicate that a character should be treated as a literal and not as a metacharacter?
A
backslash; e.g. ` *`