fork(2) download
  1. input = "AXXXA"
  2. gsub("(?:A|(?<!^)\\G)\\KX(?=X*A)", "A", input, perl=TRUE)
  3. input = "AXXA"
  4. gsub("(?:A|(?<!^)\\G)\\KX(?=X*A)", "A", input, perl=TRUE)
  5. input = "AXA"
  6. gsub("(?:A|(?<!^)\\G)\\KX(?=X*A)", "A", input, perl=TRUE)
Success #stdin #stdout 0.31s 22832KB
stdin
Standard input is empty
stdout
[1] "AAAAA"
[1] "AAAA"
[1] "AAA"