Platforms to show: All Mac Windows Linux Cross-Platform

Back to NSRegularExpressionMBS class.

NSRegularExpressionMBS.escapedPatternForString(text as String) as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Regular Expressions MBS MacCocoa Plugin 21.1 ✅ Yes ❌ No ❌ No ✅ Yes All
Returns a string by adding backslash escapes as necessary to protect any characters that would match as pattern metacharacters.

text: The string.

Returns the escaped string.

Returns a string by adding backslash escapes as necessary to the given string, to escape any characters that would otherwise be treated as pattern metacharacters. You typically use this method to match on a particular string within a larger pattern.
For example, the string "(N/A)" contains the pattern metacharacters (, /, and ). The result of adding backslash escapes to this string is "\\(N\\/A\\)".

NSRegularExpressionMBS.escapedTemplateForString(text as String) as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Regular Expressions MBS MacCocoa Plugin 21.1 ✅ Yes ❌ No ❌ No ✅ Yes All
Returns a template string by adding backslash escapes as necessary to protect any characters that would match as pattern metacharacters.

text: The template string

Returns the escaped template string.

Returns a string by adding backslash escapes as necessary to the given string, to escape any characters that would otherwise be treated as pattern metacharacters. You typically use this method to match on a particular string within a larger pattern.
For example, the string "(N/A)" contains the pattern metacharacters (, /, and ). The result of adding backslash escapes to this string is "\\(N\\/A\\)".
See Flag Options for the format of the resulting template string.

NSRegularExpressionMBS.regularExpressionWithPattern(pattern as String, options as Integer, byref error as NSErrorMBS) as NSDataDetectorMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa Regular Expressions MBS MacCocoa Plugin 21.1 ✅ Yes ❌ No ❌ No ✅ Yes All
Creates an NSRegularExpression instance with the specified regular expression pattern and options.

pattern: The regular expression pattern to compile.
options: The matching options. See constants for possible values. The values can be combined using the bitwise OR operator.
error: An out value that returns any error encountered during initialization. Returns an NSErrorMBS object if the regular expression pattern is invalid; otherwise returns nil.

Returns an instance of NSRegularExpression for the specified regular expression and options.

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


The biggest plugin in space...