Understanding Regular Expressions in Linux

preview_player
Показать описание
#DecodeITeS

Understanding regular expressions:

Regular Expressions are text patterns that are used by tools like grep and others
Don’t confuse regular expressions with globbing!
They may look like file globbing, but really are different!
Grep ‘a*’ a*
Regular expressions are for use with specific tols only: grep, vim, awk, sed
Extended regular expressions enhance basic regex features
See man 7 regex for details

Regular Expressions are built around atoms; an atom specifies what text is to be matched
Atoms can be single characters, a range of characters, or a dot
Atoms can also be a class, such as [[:alpha:]], [[:upper:]], [[:digit:]] or [[:alnum:]]
Second is the repetition operator, specifying how often a character occurs
Third element is indicating where to find the next character
Рекомендации по теме