I need to find the text of all the one-digit number.
My code:
$string = \'text 4 78 text 558 my.name@gmail.com 5 text 78998 text\'; $pattern = \'/ [\
Use word boundaries. Note that the range quantifier {1} (a single \d will only match one digit) and the character class [] is redundant because it only consists of one character.
{1}
\d
[]
\b\d\b