The regular expression is an artifact, but when you are learning Linux, there is a file name that goes with this stuff. Today we summarize the file name wildcard, regular expression, extended regular expression between what similarities and differences. May not write the whole, seek advice.
Usage Aspects :
Regular is used to match filter text content.
Wildcard characters are used to match filenames.
Support commands:
File processing, view CP find LS RM mv Touch, and a series of file matching lookup commands. (and what is said above is a meaning)
Regular expressions are used in the various tools of the text content processing Grep,awk,sed,vim the last line mode and so on.
The matching function is more regular, natural ability is more powerful, so the difference between the more points.
match the same point on the rule :
A. Character matching:
[:d Igit:] number, [: lower:] lowercase, [: Upper:] Uppercase, [: Alpha:] Letter, [: Alnum:] Alphanumeric, [:p unct:] punctuation, [: space:] space [xdigit]16 binary is the same.
[^] except in parentheses. [] Any character in parentheses matches. [] Within-, the use of both rules are the same.
Two. Number of matches
Support number matching in the regular and divided into the exact number of times and the number of blur, in the file name wildcard only support *.
File name wildcard? represents any single character and the character appears once. * indicates any character appearing any time.
Regular. In the representation of any character, * indicates that the preceding character appears any time: * denotes any character appearing any time.? indicates that the preceding character appears 1 or 0 times, indicating that the preceding character is optional. Need to be escaped.
Three. Position anchoring.
Regular support, wildcard characters are not supported.
Matches a word made up of non-special characters. Regular match, file name wildcard not supported.
Content grouping and referencing. Regular support, file name wildcard is not supported.
Because the difference between the extension regular and the filename wildcard is the same as above, it is ( ibid. ).
The difference between regular and regular is extended.
Extended regular in the number of matches? + {} does not need \ Escape character.
The word integral anchor in the position anchor <> also requires the \ Escape character.
The content grouping () also does not require the \ Escape character.
A new matching rule is provided in the extended regular, or |.
Finished writing.
Regular expressions, filename wildcard, and some similarities and differences between extended regular