Barotrauma

Barotrauma

Not enough ratings
Dictionary
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
39.027 KB
8 Mar @ 12:30am
1 Change Note ( view )

Subscribe to download
Dictionary

Description
2C Dictionary (Regex + Concat) key=value;

Concatenation Separator
;key1=val1;key2=val2;key3=val3;
Regex Expression
^(.*);(.*;)*\1=(?<val>.*?);
Regex Output
val
Regex Use Capture Group
checked (True)
  • Input signal -> Concat signal_in_1 (& 2) -> Regex signal_in
  • ^(.*); matches the input up to first ; as capture group 1. (.*;)* is for repeated key_n=val_n; until before the matching key. \1 is group 1 value (the key) matched at the start. =(?<val>.*?); outputs the value of the matched key (between key= and ;) to capture group val.
  • Wire the input to concat signal_in_1 and anything to concat signal_in_2 such as the input again (to both signal_in_1 & 2).


[Key as Range] (i-j)=value;

Concatenation Separator
;1=val1;2=val2;3=val3;
Regex Expression
^(?:(\d{1})|(\d{2})|(\d{3}));(.*;)*((?(1)1)|(?(2)2)|(?(3)3))=(?<val>.*?);
  • It additionally maps the key range to its order such as 1st = 1, 2nd = 2 etc to retrieve the value by the mapped key.
  • \d{n} matches n digits in the example, so '1' = val1, '11' = val2, ''111' = val3, ''123' = val3, 'key4' = val4
  • Extend by adding new key range such as (\d{4}) with (?(4)4) = ^(?:(\d{1})|...|(\d{4}));(.*;)*((?(1)1)|...|(?(4)4))=(?<val>.*?);.
  • You can name each key's capture group to make it clearer ^((?<k1>\d{1})|...|(?<k4>\d{4}));(.*;)*((?(k1)1)|...|(?(k4)4))=(?<val>.*?);


[Key as Range + Key] (i-j)=value;key=value;

Concatenation Separator
;1=val1;2=val2;3=val3;key4=val4;
Regex Expression
^(?:(\d{1})|(\d{2})|(\d{3})|(?<i>.*));(.*;)*((?(1)1)|(?(2)2)|(?(3)3)|(?(i)\k<i>))=(?<val>.*?);
  • (?<i>.*) matches any non range key as the "i"nput named capture group. (?(i)\k<i>) is the input as the key from the "i" capture group without mapping.
  • If an input or key isn't in a range and is a number of a capture group, then you need to either place it at the corresponding capture group or map it to another value.



Example Usage: https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=3400886610