Message Select Formatter
Select a text value based on the value of the parameter.
Format:
{ PARAMETER_NUMBER, select, VALUE1: TEXT1 | VALUE2 / VALUE3: TEXT2 | regex#VALUE_REGEX : TEXT_REGEX | OTHERWISE_TEXT}PARAMETER_NUMBER:Number of the parameter which value is matched against the values of the select list
VALUE*:If a values matches the value of the parameter, the corresponding text (TEXT*) is selected
List of several values for the same text can be separated by slash "/"
VALUE_REGEXWhen the value is prefixed by "regex#", it is seen as regular repression, e.g.
regex#([A-Z])\w+If the regex matches the value of the parameter, the corresponding text (TEXT_REGEX) is selected
TEXT*:Text that is returned by the pattern if the value matches the value of the parameter
Texts themselves can also contain patterns. So, the patterns can be nested.
TEXT_REGEXLike TEXT* but regex-groups can be refereed by
OTHERWISE_TEXTIf none of the values before matched, this text will be selected
If there is no OTHERWISE_TEXT specified and no value matches, an empty string is returned
Values and texts are trimmed (leading and tailing whitespaces are removed)
Example:
{0} has forgotten {1, select, female: her | his } {3, select, one: bag | {2} bags}.Usage:
FORGOTTEN_BAG("Peter", "male", 1, "one")
-> Peter has forgotten his bag.
FORGOTTEN_BAG("Mary", "female", 2, "few")
-> Mary has forgotten her 2 bags.