Description:
Find if a string matches a format string.
Syntax:
like(stringExp, formatExp)
Note:
The function checks if the string stringExp matches the format string formatExp. In the formate string, the symbol asterisk "*" matches 0 or multiple characters; and the question mark "?" matches a single character. An escape character is used to make "*" match the character itself, for example, \* is escaped to * and \\ to \.
Parameters:
stringExp |
A string expression |
formatExp |
A format string expression |
Option:
@c |
It makes the matching case-insensitive, while the default is case-sensitive. |
Return value:
Boolean value
Examples:
like("abc123", "abc*") |
true |
like("abc123", "abc1?3") |
true |
like("abc123", "abc*34") |
false |
like("abc123", "ABC*") |
false |
like@c("abc123", "ABC*") |
true |
like ("abc*123", "abc\*") |
true |
true abc\\** is escaped to abc\** |