function indexOfPattern ($pattern)
  {
    self::toUnicodeRegex ($pattern);
    if (!preg_match ($pattern, $this->S, $m, PREG_OFFSET_CAPTURE)) return false;
    return $m[0][1];
  }
function indexOfPattern ($pattern)
  {
    self::toUnicodeRegex ($pattern);
    if (!preg_match ($pattern, $this->S, $m, PREG_OFFSET_CAPTURE)) return false;
    return $m[0][1];
  }
function indexOfPattern ( $ pattern ) { self :: toUnicodeRegex ( $ pattern ) ; if ( ! preg_match ( $ pattern , $ this -> S , $ m , PREG_OFFSET_CAPTURE ) ) return false ; return $ m [ 0 ] [ 1 ] ; }
Searches for a pattern on a string and returns the index of the matched substring.

><p>This is a simpler version of {@see search}.

@param string $pattern A regular expression pattern.
@return int The index of the matched substring.
Searches for a pattern on a string and returns the index of the matched substring .