fork(5) download
  1. var str = 'Hey man :), how\'re you? :) My friend told me "this can\'t be true :)..." abc :) foo';
  2. str = str.replace(/(:\))(?=(?:(?:[^"]*"){2})*[^"]*$)/g, ':D');
  3. print("matched: " + str);
Success #stdin #stdout 0.38s 381952KB
stdin
Standard input is empty
stdout
matched: Hey man :D, how're you? :D My friend told me "this can't be true :)..." abc :D foo