I have code to separate text with punctuation.
$text = "I was eating at a restaurant.";
echo $text . "<br>";
$token = preg_replace('/([\.\,\(\)\'\"\!\?\:\;])/', " \\1", $text);
echo $token;
And the output like this
I was eating at a restaurant.
I was eating at a restaurant .
I want to ask, What is the meaning " \\1" in that replacement? I am still confused.
Can someone explain it?