]>
Commit | Line | Data |
---|---|---|
8868edaf CR |
1 | # This program is free software: you can redistribute it and/or modify |
2 | # it under the terms of the GNU General Public License as published by | |
3 | # the Free Software Foundation, either version 3 of the License, or | |
4 | # (at your option) any later version. | |
5 | # | |
6 | # This program is distributed in the hope that it will be useful, | |
7 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
8 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
9 | # GNU General Public License for more details. | |
10 | # | |
11 | # You should have received a copy of the GNU General Public License | |
12 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | |
13 | # | |
95732b49 JA |
14 | shopt -s extglob |
15 | ||
16 | [[ ab/../ == @(ab|+([^/]))/..?(/) ]] && echo match 1 | |
17 | ||
18 | [[ ab/../ == +([^/])/..?(/) ]] && echo match 2 | |
19 | ||
20 | [[ ab/../ == @(ab|?b)/..?(/) ]] && echo match 3 | |
21 | ||
22 | [[ ab/../ == +([^/])/../ ]] && echo match 4 | |
23 | ||
24 | [[ ab/../ == +([!/])/..?(/) ]] && echo match 1a | |
25 | ||
26 | [[ ab/../ == @(ab|+([!/]))/..?(/) ]] && echo match 1b | |
27 | ||
28 | [[ ab/../ == +([!/])/../ ]] && echo match 2a | |
29 | ||
30 | [[ ab/../ == +([!/])/..?(/) ]] && echo match 2b | |
31 | ||
32 | [[ ab/../ == +([!/])/..@(/) ]] && echo match 3a | |
33 | ||
34 | [[ ab/../ == +(ab)/..?(/) ]] && echo match 3b | |
35 | ||
36 | [[ ab/../ == [!/][!/]/../ ]] && echo match 4a | |
37 | ||
38 | [[ ab/../ == @(ab|?b)/..?(/) ]] && echo match 4b | |
39 | ||
40 | [[ ab/../ == [^/][^/]/../ ]] && echo match 5 | |
41 | ||
42 | [[ ab/../ == ?b/..?(/) ]] && echo match 6 | |
43 | ||
44 | [[ ab/../ == +(?b)/..?(/) ]] && echo match 7 | |
45 | ||
46 | [[ ab/../ == +(?b|?b)/..?(/) ]] && echo match 8 | |
47 | ||
48 | [[ ab/../ == @(?b|?b)/..?(/) ]] && echo match 9 | |
49 | ||
50 | [[ ab/../ == @(a?|?b)/..?(/) ]] && echo match 10 | |
51 | ||
52 | [[ ab/../ == ?(ab)/..?(/) ]] && echo match 11 | |
53 | ||
54 | [[ ab/../ == ?(ab|??)/..?(/) ]] && echo match 12 | |
55 | ||
56 | [[ ab/../ == @(??)/..?(/) ]] && echo match 13 | |
57 | ||
58 | [[ ab/../ == @(??|a*)/..?(/) ]] && echo match 14 | |
59 | ||
60 | [[ ab/../ == @(a*)/..?(/) ]] && echo match 15 | |
61 | ||
62 | [[ ab/../ == +(??)/..?(/) ]] && echo match 16 | |
63 | ||
64 | [[ ab/../ == +(??|a*)/..?(/) ]] && echo match 17 | |
65 | ||
66 | [[ ab/../ == +(a*)/..?(/) ]] && echo match 18 | |
67 | ||
68 | # | |
69 | j="@(x)" ; [[ x == $j ]] && echo ok 19 |