fork download
  1. s='
  2. printf("gcd=%d\n", gcd(12, 8));
  3. if(3<4)printf("hello, world");
  4. printf("%d %d %f \n", gcd(1, 2), lcd(2, 3), total(3, 4));
  5. '
  6. puts a=s.scan(/(printf(\(((?>[^()]+)|\g<2>)*\)))/).map(&:first)
Success #stdin #stdout 0.02s 9720KB
stdin
Standard input is empty
stdout
printf("gcd=%d\n", gcd(12, 8))
printf("hello, world")
printf("%d %d %f \n", gcd(1, 2), lcd(2, 3), total(3, 4))