RegexFun/Test1

From CODECS Dev

match and replace match with o

{{#regex:* first point 
|/^[*]/
|o
}}
o first point


match and set match to switch in variable definition

<div>{{#regex:: first point 
|/^([\*\;:]+)/e
|{{#vardefine:@test| {{#switch: $1 |*=bullet1 |**=bullet2 |;=semicolon |:=colon }} }}
}}
</div>
var = {{#var:@test}}
first point
var = colon


Manifest

https://www.isos.dias.ie/static/manifests/RIA_MS_23_P_12.json


A simple example of the difference, with only a small bit of preprocessing

Before the new Parsoid
{{#vardefine:@category
|{{#arraymap:{{{category|}}}
|;
|@@@
|{{#switch:@@@|no item=|#default=@@@}}
|;
}} 
}}
{{#set:
|categories={{#var:@category|unclassified}}|+sep=;
}}

{{#if:{{#var:@category}} |Categories: {{#var:@category}} }}

After
{{#set:
|categories={{#if:{{#arraymap:{{{category|}}}
|;
|@@@
|{{#switch:@@@|no item=|#default=@@@}}
|;
}}
|{{#arraymap:{{{category|}}}
|;
|@@@
|{{#switch:@@@|no item=|#default=@@@}}
|;
}}
|unclassified
}}|+sep=;
}}

{{#if:{{#arraymap:{{{category|}}}
|;
|@@@
|{{#switch:@@@|no item=|#default=@@@}}
|;
}}
|Categories: {{#if:{{#arraymap:{{{category|}}}
|;
|@@@
|{{#switch:@@@|no item=|#default=@@@}}
|;
}}
}}