$wildtok » History » Version 2
Per Amundsen, 08/10/2015 06:24 AM
1 | 1 | Per Amundsen | _Added in 1.9.0_ |
---|---|---|---|
2 | |||
3 | *$wildtok(text,wildstring,N,C)* |
||
4 | |||
5 | Returns the Nth token that matches the wildcard string. |
||
6 | |||
7 | _[[$wildtok]] is case-insensitive, see [[$wildtokcs]] for case-sensitive version._ |
||
8 | |||
9 | *Parameters* |
||
10 | |||
11 | text - The text to tokenize. |
||
12 | wildstring - String to search. |
||
13 | N - If N = 0, return number of matching tokens, otherwise the Nth token. |
||
14 | C - The "ASCII":http://www.asciitable.com/ value to tokenize by. |
||
15 | |||
16 | *Example* |
||
17 | |||
18 | <pre> |
||
19 | ; Prints the number of matches from the wildstring 't*'. |
||
20 | //echo -ag $wildtok(one two three, t*, 0, 32) |
||
21 | |||
22 | 2 | Per Amundsen | ; Prints the first match from the wildstring 't*e'. |
23 | 1 | Per Amundsen | //echo -ag $wildtok(one two three, t*e, 1, 32) |
24 | </pre> |