USE: pcre2 "mul\\([0-9]+,[0-9]+\\)" findall [ first second "mul(" ?head drop ")" ?tail drop "," splitting:split [ string>number ] map product ] map-sum USE: pcre2 "do\\(\\)|don't\\(\\)|mul\\([0-9]+,[0-9]+\\)" findall [ first second ] map [ [ { [ "do(" head? ] [ "don't(" head? ] } 1|| ] [ "mul(" head? ] bi* or ] monotonic-split [ first "don't()" = ] reject concat [ "do()" = ] reject [ "mul(" ?head drop ")" ?tail drop "," splitting:split [ string>number ] map product ] map-sum