Ch8 Regular Expressions Exam
-
If you want to use
grep
without regard to the capitalization of text, you can use the option:-v
-r
-t
-i
-
The regular expression
a?
is equivalent to:- a{0,1}
- a{1,}
- a{1}
- a{0,}
-
The regular expression
a*
is equivalent to:- a{1}
- a{0,1}
- a{0,}
- a{1,}
-
The regular expression
a+
is equivalent to:- a{1,}
- a{0,1}
- a{0,}
- a{1}
-
To get the
grep
command to show the names of files that matched instead of the content that matched, you can use the option:- -l
- -n
- -q
- -f
-
To use extended regular expressions, you can use:
(choose two)
grep -E
egrep
grep -e
fgrep
-
To use regular expression characters to match themselves, you cannot:
- Put the character in the square brackets
- Use the slash in front of the character
- Use the fgrep command
- Use the backslash in front of the character
-
What does the vertical bar
|
character do in a regular expression?- Separates repetition modifiers
- Separates alternative patterns that can be matches
- Redirects input to the command
- Redirects output from the command
-
What is not a purpose of using parentheses around parts of a regular expression?
- They can be used to group characters for repetition
- They can be used to refer back to what was matched
- They can be used to make alternation more efficient
- They can be used to change the order that the pattern is evaluating
-
What is the reason you would use the
grep
command with a quiet-q
option?- You do not want to write anything to standard output
- You don’t want grep to make noise
- You want the output to be redirected to a file
- You want the output to be small
-
Which of the following regular expression characters is an extended regular expression character?
- *
- $
- .
- +
-
Which option for the
grep
command will invert the pattern matching results?- -o
- -v
- -r
- -i
-
Which regular expression character matches any one character?
- *
- .
- ?
- +
-
Which regular expression character matches one or more of the previous character?
- –
- *
- $
- +
-
Which regular expression character matches zero or more of the previous character?
- .
- +
- ?
- *
Subscribe
0 Comments
Newest