From: ciapecki [mailto:[email protected]]
irb(main):006:0> s.gsub( /\b([a-z]) (?=[a-z]\b)/i, ‘\1’ )
=> “A long cat and a quick mouse met oj simpson on the tcp stack”
this is exactly what I need.
Is it possible to rewrite it without using lookahead (?=subexp) ?
I don’t think so, unless you have a positive lookbehind instead.
Why don’t you want the lookahead? Are you actually using this regexp
with a language other than Ruby?