Platforms to show: All Mac Windows Linux Cross-Platform

Back to NSDataDetectorMBS class.

NSDataDetectorMBS.Constructor(checkingTypes as Integer, byref error as NSErrorMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Regular Expressions MBS MacCocoa Plugin 21.1 ✅ Yes ❌ No ❌ No ✅ Yes All
Initializes and returns a data detector instance.
Example
// create detector for phone number
Dim types As Integer = NSTextCheckingResultMBS.NSTextCheckingTypePhoneNumber
Dim Error As NSErrorMBS
Dim DataDetector As New NSDataDetectorMBS(types, error)

Dim s As String = "Call us at (555)-555-555 today!"

// look for the phone number now
Dim m() As NSTextCheckingResultMBS = DataDetector.matches(s, 0)

// show first phone number found
Dim r As NSTextCheckingResultMBS = m(0)
MsgBox r.phoneNumber

checkingTypes: The checking types. The supported checking types are a subset of the types NSTextCheckingType. Those constants can be combined using the BitWiseOR() function.
error: An out parameter that if an error occurs during initialization contains the encountered error.

Returns the newly initialized data detector. If an error was encountered returns nil, and error contains the error.

Currently, the supported data detectors checkingTypes are: NSTextCheckingTypeDate, NSTextCheckingTypeAddress, NSTextCheckingTypeLink, NSTextCheckingTypePhoneNumber, and NSTextCheckingTypeTransitInformation.

See also:

NSDataDetectorMBS.Constructor(script as string, options as Integer, byref error as NSErrorMBS)   Private

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Regular Expressions MBS MacCocoa Plugin 21.1 ✅ Yes ❌ No ❌ No ✅ Yes All
Private constructor.

Here to prevent you from accidentally calling the constructor for NSRegularExpressionMBS class.

See also:

NSDataDetectorMBS.copy as NSDataDetectorMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Regular Expressions MBS MacCocoa Plugin 21.1 ✅ Yes ❌ No ❌ No ✅ Yes All
Creates a copy of the object.

The items on this page are in the following plugins: MBS MacCocoa Plugin.


The biggest plugin in space...