So I am new to Javascript and Regular expressions and I am looking forward to do the following in the most minimal and efficient way using Javascript regular expressions:-
2 or more sequential '?' followed by an 's' and followed by a space, comma, or period, replace with an apostrophe. Else remove the sequence of 2 or more sequential '?' (don't replace with a space).
I tried doing something like this:
str.replace(/?{2,}s,/g,"'s,");
str.replace(/?{2,}s./g,"'s.");
str.replace(/?{2,}s\s/g,"'s ");
But I am not sure how to do it in one line