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
syntax:pattern [2021/08/24 21:18]
fgrose [Patterns and pattern matching] comma
syntax:pattern [2021/10/21 00:52] (current)
fgrose links to POSIX character classes & collation symbols
Line 31: Line 31:
 |''​[XYZ]''​|The "​normal"​ bracket expression, matching either ''​X'',​ ''​Y''​ or ''​Z''​| |''​[XYZ]''​|The "​normal"​ bracket expression, matching either ''​X'',​ ''​Y''​ or ''​Z''​|
 |''​[X-Z]''​|A range expression: Matching all the characters from ''​X''​ to ''​Y''​ (your current **locale**, defines how the characters are **sorted**!)| |''​[X-Z]''​|A range expression: Matching all the characters from ''​X''​ to ''​Y''​ (your current **locale**, defines how the characters are **sorted**!)|
-|''<​nowiki>​[[:​class:​]]</​nowiki>''​|Matches all the characters defined by a POSIX(r) character class: ''​alnum'',​ ''​alpha'',​ ''​ascii'',​ ''​blank'',​ ''​cntrl'',​ ''​digit'',​ ''​graph'',​ ''​lower'',​ ''​print'',​ ''​punct'',​ ''​space'',​ ''​upper'',​ ''​word''​ and ''​xdigit''​|+|''<​nowiki>​[[:​class:​]]</​nowiki>''​|Matches all the characters defined by a [[https://​pubs.opengroup.org/​onlinepubs/​009696899/​basedefs/​xbd_chap07.html#​tag_07_03_01|POSIX(r) character class]]: ''​alnum'',​ ''​alpha'',​ ''​ascii'',​ ''​blank'',​ ''​cntrl'',​ ''​digit'',​ ''​graph'',​ ''​lower'',​ ''​print'',​ ''​punct'',​ ''​space'',​ ''​upper'',​ ''​word''​ and ''​xdigit''​|
 |''​[^...]''​|A negating expression: It matches all the characters that are **not** in the bracket expression| |''​[^...]''​|A negating expression: It matches all the characters that are **not** in the bracket expression|
 |''​[!...]''​|Equivalent to ''​[^...]''​| |''​[!...]''​|Equivalent to ''​[^...]''​|
Line 60: Line 60:
     * => ''​Hello world+''​     * => ''​Hello world+''​
     * => ''​Hello world?''​     * => ''​Hello world?''​
-  * Pattern ''<​nowiki>​[[.backslash.]]Hello[[.vertical-line.]]world[[.exclamation-mark.]]</​nowiki>''​ matches (using collation ​sybols)+  * Pattern ''<​nowiki>​[[.backslash.]]Hello[[.vertical-line.]]world[[.exclamation-mark.]]</​nowiki>''​ matches (using ​[[https://​pubs.opengroup.org/​onlinepubs/​009696899/​basedefs/​xbd_chap07.html#​tag_07_03_02_04|collation ​symbols]])
     * => ''​\Hello|world!''​     * => ''​\Hello|world!''​
  
  • syntax/pattern.1629839933.txt
  • Last modified: 2021/08/24 21:18
  • by fgrose