Regular extension of regular expressions

Extended regular

Extended regular, referring to the expression contains: +? | {} And other symbols, which can not be directly used in the grep, and needs \ Tinto meaning
if you do not add \ extension of righteousness, then you can use egrep or grep -E carried out using the
extended regular: sed -r, and grep options, contains a +? | {} When symbols need to add r option, if not you need to add \ Tinto justice
awk default support grep, sed all the features of
awk which compare the size can not be compared with numbers and letters, this comparison does not come out
extended regular + |? { }
? extended regular expression:? previous character 0 or 1
A1? ==> a or a1

  • Extended regular expression: + foregoing character has positive integer
    | extended regular represents: or
    {} indicates a range

The meaning of some special symbols:

Indicates any one character

  • A B 0 : in front of the character has zero or more
    ABC
    ab & abccc
    .
    represents greedy matching
    egrep 'ABC | 123' 1.txt
    [] inside the square brackets represents a character
    [a-zA-Z0-9] [ abc ] [a | @] [^]
    ^ represents the beginning
    $ indicates the end of
    a {l, 5} {B}. 3
    () inside the parentheses characters as a whole
    (ABC) {2} == "ABCABC
    (ABC) +
    {2} == ABC> ABCC
    awk -F '[#: |]'

Guess you like

Origin blog.51cto.com/13292790/2439867