Regexps are most commonly used with the Linux commands:- grep, sed, tr, vi.
The backtick(`) is actually called command substitution.
Some basic regular expressions:
Sr. no.
Symbol
Description
1.
.
It is called a wild card character, It matches any one character other than the new line.
2.
^
It matches the start of the string.
3.
$
It matches the end of the string.
4.
*
It matches up to zero or more occurrences i.e. any number of times of the character of the string.
5.
\
It is used for escape following character.
6.
()
It is used to match or search for a set of regular expressions.
7.
?
It matches exactly one character in the string or stream.
Text File Used:Fruits-name, it is a text file with MS-DOS line terminator which need to be coverted to Unix text file. Or create a file with the name of fruit.txt, and filled with the content below: