Go to: Return value. Related commands. Examples.
* | matches any string |
? | matches any single character |
[...] | Matches any one of the enclosed characters. A pair of characters separated by - matches any character lexically between the pair, inclusive. If the first character following the opening "[ " is a "!" any character not enclosed is matched. A - can be included in the character set by putting it as the first or last character. |
gmatch "matches" "m*s"; // Result: 1 // gmatch "matches" "mat*"; // Result: 1 // gmatch "matches" "ma[a-z]ches"; // Result: 1 // gmatch "matches" "ma[!a-m]ches"; // Result: 1 // gmatch "matches" "ma?ches"; // Result: 1 // gmatch "no match" "?atch"; // Result: 0 //