fork(2) download
  1. #!/usr/bin/perl6
  2. my regex paren_any { '(' ~ ')' [ <-[()]>+ || <&paren_any> ]* }
  3. say "Extract (a(b)c) and ((d)f(g))" ~~ m:g/<&paren_any>/;
  4. say "Extract (a(b)c) and ((d)f(g))" ~~ m:ov:g/<&paren_any>/;
  5.  
  6.  
Success #stdin #stdout 0.13s 109120KB
stdin
Standard input is empty
stdout
(「(a(b)c)」 「((d)f(g))」)
(「(a(b)c)」 「(b)」 「((d)f(g))」 「(d)」 「(g)」)