syntax:pattern

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
syntax:pattern [2015/08/13 03:53]
bill_thomson
syntax:pattern [2021/08/23 17:12]
fgrose [Patterns and pattern matching] not to be confused with reqular expressions
Line 11: Line 11:
 The pattern description language is relatively easy. Any character that's not mentioned below matches itself. The pattern description language is relatively easy. Any character that's not mentioned below matches itself.
 The ''​NUL''​ character may not occur in a pattern. If special characters are quoted, they'​re matched literally, i.e. without their special meaning. The ''​NUL''​ character may not occur in a pattern. If special characters are quoted, they'​re matched literally, i.e. without their special meaning.
 +
 +Do **not** confuse patterns with **//regular expressions//​**,​ because they share some symbols and do similar matching work.
  
 ===== Normal pattern language ===== ===== Normal pattern language =====
Line 63: Line 65:
 ===== Extended pattern language ===== ===== Extended pattern language =====
  
-If you set the [[internals:​shell_options | shell option]] ''​extglob'',​ Bash understands some powerful patterns. A ''<​PATTERN-LIST>''​ is one or more patterns, separated by the pipe-symbol (''​|''​).+If you set the [[internals:​shell_options | shell option]] ''​extglob'',​ Bash understands some powerful patterns. A ''<​PATTERN-LIST>''​ is one or more patterns, separated by the pipe-symbol (''​PATTERN|PATTERN''​).
  
 |''?​(<​PATTERN-LIST>​)''​|Matches **zero or one** occurrence of the given patterns| |''?​(<​PATTERN-LIST>​)''​|Matches **zero or one** occurrence of the given patterns|
  • syntax/pattern.txt
  • Last modified: 2021/10/21 00:52
  • by fgrose