Search text using regular expressions Flashcards
What are the two forms of regular expression?
Basic and extended
Describe a bracket expression?
Any character in the square brackets is matched on
Describe a range expression?
Any character in the range of characters is the square brackets is matched on
What regex character represent any single character?
.
What regex character represents the start of a line?
What regex character represents the end of a line?
$
How are multiple possible strings defined?
|
What are used to separate subexpressions?
( )
What is the escape character?
\
What command will search files for a specified string?
grep
What command is the equivalent of grep -E (extended) ?
egrep
What command is the equivalent of grep -F (fixed strings) ?
fgrep
What type of grep would be best suited to search for user mark.reed?
fgrep - fixed
What type of grep would be best suited to search for a mix of possible matches?
egrep - extended
In which grep mode do the meta-characters ?, +, {, |, (, and ) lose their special meaning?
regular
Regex which character - the preceding item is optional and matched at most once?
?
Regex which character - the preceding item will be matched zero or more times?
*
Regex which character - the preceding item will be matched one or more times?
+
What should be used for filtering and transforming text?
sed
What sed switch will make a change to a file without outputing the result to stdout?
-i –in-place
What letter in sed will replace the first occurance on a line?
s (substitute)
What letter when used after the expression will change every occurance of a string?
g (global)
What letter when used after the expression will write the output to a file?
w (write)