.. highlightlang:: us .. _strmatch: strmatch ======== .. index:: strmatch .. us.tag strmatch ENGLISH STR :ref:`strmatch` checks if elements of a string matrix match a pattern. .. function:: rmBool = strmatch(ssPattern, smString) .. us.return **Return Value** *rmBool* is real matrix. A matrix element of *rmBool* is True (1), if the corresponding string element of *smString* matches the pattern *ssPattern*, and False (0), if the corresponding element of *smString* does not match the pattern. .. us.params **Parameters** .. uparam:: ssPattern *ssPattern* is a scalar string containing a pattern. .. list-table:: :header-rows: 1 * - Value - Meaning * - \* - Match zero or more characters. * - ? - Match any single character. * - [SET] - Matches any character in the specified set. * - [!SET] or [^SET] - Matches any character not in the specified set. For example, the pattern [aAbB] or [0-9A-Z] will match the numbers 0 to 9 and all upper case alphabetic characters. If any of the characters []\*?!^-\ are used in [SET], a double backslash "\\" .. uparam:: smString *smString* is a string matrix. .. us.comment **Comment** A set is composed of characters or ranges; a range looks like character hyphen character (as in 0-9 or A-Z). ``[0-9a-zA-Z_]`` is the minimal set of characters allowed in the [..] pattern construct. To suppress the special syntactic significance of any of ``[]*?!^-\``, and match the character exactly, precede it with a ``\\``. .. us.example **Example** The following example shows how to find out if a string contains small letters. :: * strmatch("*[a-z]*", ["Hallo", "HALLO"]) 1.0000 0.0000 .. us.example **Example** :: * strmatch("hello", "hello") 1.0000 * strmatch("hello", "Hello") 0.0000 * strmatch("[hH]ello", "Hello") 1.0000 * strmatch("*ello", "Hello") 1.0000 * strmatch("*el?o", "Hello") 1.0000 * what("strm*") strmatch 1 function(s) defined * what("str[!m]*") strchar strCharToOem strcode strempty strfindreplace strlen strlower strOemToChar strsplit strtod strtofield strtok strtrim strupper 14 function(s) defined * strmatch("*\*\*CHAN[0-9]\*\**", ["asdf**CHAN1**asdf", "asdf"]) 1.0000 0.0000 .. seealso:: :ref:`overview-strings`, :ref:`strmatchi` :sub:`id-1415657`