regexCount#

swordfish.function.regexCount()#

Search in str from the offset position, and return an integer indicating how many times a string that matches pattern occurs in str.

Parameters:
  • str (Constant) – A string or a string vector.

  • pattern (Constant) – An ordinary string scalar or a regular expression pattern to be searched in str. Regular expression pattern includes character literals, metacharacters, or a combination of both.

  • offset (Constant, optional) – A non-negative integer with default value of 0. This optional argument is the starting position in str to conduct the count operation. The first character in str corresponds to position 0.