79556813

Date: 2025-04-05 10:26:35
Score: 1.5
Natty:
Report link

Why keep it simple when you can make it complicated? (French expression ;-)

My goal was to avoid automatic line breaks between a word and a punctuation mark.

I just thought it would be much simpler to replace the space with  !

So I do this for the punctuation marks at the end:

[ ]+([\?\:!€"»;\)\]}])

Replace by  $1

And this for the punctuation marks at the beginning:

(["«\(\[{])[ ]+([\w])

Replace by $1 $2

I think that will be enough.

Reasons:
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Self-answer (0.5):
  • Starts with a question (0.5): Why
  • Low reputation (0.5):
Posted by: usualuser