fork(1) download
  1. x = "The 'quick cunning brown' fox 'jumps up and over' the lazy dog"
  2. gr <- gregexpr("'[^']+'", x)
  3. mat <- regmatches(x, gr)
  4. regmatches(x, gr) <- lapply(mat, gsub, pattern="\\s", replacement="_")
  5. x
  6.  
Success #stdin #stdout 0.2s 178496KB
stdin
Standard input is empty
stdout
[1] "The 'quick_cunning_brown' fox 'jumps_up_and_over' the lazy dog"