fork download
  1. # your code goes here
  2.  
  3. gsub("(?:^.*?keyword\\b|\\G(?!^))[^\\[\\]]*\\K[\\[\\]]", "", "ab[ cd] ef keyword [ gh ]keyword ij ", perl=T)
Success #stdin #stdout 0.21s 39444KB
stdin
Standard input is empty
stdout
[1] "ab[ cd] ef keyword  gh keyword ij "