Class IsMatchFormatter
Formatter with evaluation of regular expressions.
Inherited Members
Namespace: UnityEngine.Localization.SmartFormat.Extensions
Assembly: Unity.Localization.dll
Syntax
[Serializable]
public class IsMatchFormatter : FormatterBase, IFormatter, ISerializationCallbackReceiver, IFormatterLiteralExtractor
Remarks
Syntax: {value:ismatch(regex): format | default} Or in context of a list: {myList:list:{:ismatch(^regex$):{:format}|'no match'}|, | and }
Constructors
Name | Description |
---|---|
IsMatchFormatter() | Creates a new instance of the formatter. |
Properties
Name | Description |
---|---|
DefaultNames | |
RegexOptions | The options that are provided when evaluating the expression. |
Methods
Name | Description |
---|---|
TryEvaluateFormat(IFormattingInfo) | Writes the current value to the output, using the specified format. IF this extension cannot write the value, returns false, otherwise true. |
WriteAllLiterals(IFormattingInfo) | Ignores the format arguments and writes every possible literal value. This is used to extract all possible values so that we can determine the distinct characters for font generation etc. |