I’m not a RegExp Master..

I’ve tried to create a regular expression that can trasform each aphostrophe to an escaped person but my attempt with irb driven me to a very strange behavior:

  irb(main):001:0> "string ' with aphostrophe" => "string ' with aphostrophe" irb(main):002:0> "string ' with aphostrophe".gsub("'","\\'") => "string with aphostrophe with aphostrophe"  

Can you explain me why the expression I wrote duplicate everything after the aphostrophe ?
Can you lead me to a solution ?

Thank you guys.

Sandro