I have the following string:
See it now! .5..%..off your purchase!.Only today.
I would like it to be
See it now! 5% off your purchase! Only today.
Which is:
every special character followed by zero or more spaces and one or more periods, will be replaced with the special character and a space. In case of a number and 2 periods, it will be replace with spaces only
How can I do it?
\Try this
This matches one or more spaces or periods which are preceded by a non-word boundary. These are then replaced by a single space.
Edit
Based on the amended question:
Also matches a digit followed by one or more periods. The periods are replaced by a single space.