IsMatchFormatter
Formats values by matching them against a regular expression, and can output matching group values.
Read time 1 minuteLast updated 11 days ago
Definition
- Type: Class
- Namespace: Unity.SmartStrings.Extensions
- Assembly: UnityEngine.SmartStringsModule
- Inherits from: FormatterBase
- Implements: IFormatter, IInitializer, IFormatterLiteralExtractor
public class IsMatchFormatter : FormatterBase, IFormatter, IInitializer, IFormatterLiteralExtractor
Remarks
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. |
| RegexOptions | The IsMatchFormatter.RegexOptions for the Regex expression. |
| SplitChar | The character used to split the option text literals. Valid characters are: | (pipe) , (comma) ~ (tilde) |