(For some reason, when I emailed this message, it didn't get through,
although a reply which I posted later did, so apologies if this is a
duplicate)

I am trying to create some code to edit user input, in particular, to
ensure that there is a space after a period.

That is, I want to change "Hello world.Hello world" into "Hello world.
Hello world" 

I have got as far as
preg_replace('/\.\S/i', ". $0", 'Hello world.Hello world'); 
which gives me
"Hello world. .Hello world"

Can anyone figure out the correct code?

Reply via email to