.. highlightlang:: us .. _strmatchi: strmatchi ========= .. index:: strmatchi .. us.tag strmatchi ENGLISH STR New412 :ref:`strmatchi` returns a vector of indices of those matrix elements which match the given pattern. .. function:: rvIndex = strmatchi(ssPattern, smString) .. us.return **Return Value** *rvIndex* is real vector. The vector contains the element indices of those matrix elements which match the given pattern. If no element is found the function returns the value 0. .. 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] - Match the list of characters. * - [!SET] or [^SET] - Match all characters except those specified in the list. 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. :: * strmatchi("*[a-z]*", ["Hello", "HELLO", "HEllo"]) 1.0000 3.0000 .. seealso:: :ref:`overview-strings`, :ref:`strmatch`, :ref:`regex` :sub:`id-447035`