10 if (!exists($uuids{$uuid})) {
11 $uuids{$uuid} = $n_uuids++;
13 return "<$uuids{$uuid}>";
18 my (@uuids) = sort { $a <=> $b } (grep(/\d+/, split(/(\d+)/, $s)));
19 return '["set",[' . join(',', map('["uuid","<' . $_ . '>"]', @uuids)) . ']]';
22 my $u = '[0-9a-fA-F]';
23 my $uuid_re = "${u}{8}-${u}{4}-${u}{4}-${u}{4}-${u}{12}";
25 s/($uuid_re)/lookup_uuid($1)/eg;
27 # Sort sets like this:
28 # [["uuid","<1>"],["uuid","<0>"]]
30 # [["uuid","<0>"],["uuid","<1>"]]
31 s/(\["set",\[(,?\["uuid","<\d+>"\])+\]\])/sort_set($1)/ge;