fork download
  1. a = []
  2. puts "\n2 hel2 lo".enum_for(:scan, /(?<![^[:space:]])2([[:space:].)])/).map{Regexp.last_match.begin(0)}
  3. puts "\n2 hel2 lo".enum_for(:scan, /(?<=\s|^)2\s/).map{Regexp.last_match.begin(0)}
Success #stdin #stdout 0.01s 28688KB
stdin
Standard input is empty
stdout
1