Assignment 7
Assignment 7
Linux comes with GNU grep, which supports extended regular expressions. GNU grep is the
default on all Linux systems. The grep command is used to locate information stored
anywhere on your server or workstation. Let us see fundamental of regex and how to use
regular expressions in the Linux and Unix like systems.
^w1
w1|w2
[^ ]
foo
bar
[0-9]
1. basic (BRE)
2. extended (ERE)
3. perl (PCRE)
Anchors
Anchors tell where the next character in the pattern must
be located in the text data.
BACK REFERENCES: \N
Sequence Operator
In a sequence operator, if a series of atoms are shown in
a regular expression, there is no operator between them.
Repetition Operator: \{...\}
Group Operator
23