Version: Unity 6.7 Alpha (6000.7)
LanguageEnglish
  • C#

IsMatchFormatter

class in Unity.SmartStrings.Extensions

/

Inherits from:Unity.SmartStrings.Core.Extensions.FormatterBase


Implements interfaces:IFormatterLiteralExtractor, IInitializer

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

Formats values by matching them against a regular expression, and can output matching group values.

Syntax: {value:ismatch(regex): format | default}

Or in context of a list: {myList:list:{:ismatch(^regex$):{:format}|'no match'}|, | and }

Or with output of the first matching group value: {value:ismatch(regex):First match in '{}'
: {m[1]}|No match}

Properties

Property Description
PlaceholderNameForMatches The name of the placeholder used to output RegEx matching group values. Example: {value:ismatch(regex):First match in '{}': {m[1]}|No match} "m" is the PlaceholderNameForMatches
RegexOptions The IsMatchFormatter.RegexOptions for the Text.RegularExpressions.Regex expression.
SplitChar The character used to split the option text literals. Valid characters are: | (pipe) , (comma) ~ (tilde)

Inherited Members

Properties

PropertyDescription
DefaultName Default name to use when FormatterBase.Name is null.