macOS/iOS API解説

iOS , Mac アプリケーション開発のために使われる主要フレームワークの日本語情報です。2010年代に書かれた内容です。今後更新はありません。

目次

numberOfMatchesInString:options:range:

INDEX>UIKit>NSRegularExpression

- (NSUInteger)numberOfMatchesInString:(NSString *)string 
                          options:(NSMatchingOptions)options 
                          range:(NSRange)range

解説

引数


返り値


クラス

NSRegularExpression

使用可能

OS X 10.7以降
iOS 4.0以降

参照

サンプル

numberOfMatchesInString:options:range:
Returns the number of matches of the regular expression within the specified range of the string.


Parameters
string
The string to search.
options
The matching options to use. See “NSMatchingOptions” for possible values.
range
The range of the string to search.
Return Value
The number of matches of the regular expression.

Discussion
This is a convenience method that calls enumerateMatchesInString:options:range:usingBlock:.

Availability
Available in iOS 4.0 and later.
See Also
– enumerateMatchesInString:options:range:usingBlock:
– matchesInString:options:range:
– firstMatchInString:options:range:
– rangeOfFirstMatchInString:options:range:
Declared In
NSRegularExpression.h