I am trying to replace " on inch i.e. 12" wall would become 12 inch wall
I have 2 patterns working:
/\b([0-9]+)"/ -> preg_replace('/\b([0-9]+)"/', '$1 inch ', $string)
and
/\b([0-9]*)"/ -> preg_replace('/\b([0-9]*)"/', '$1 inch ', $string)
what is a difference between them then, why + and * works same way here ?
cheers,
/Marcin
The + means find the previous character/group 1 or more times.
The * means find the previous character/group any amount of times (0-infinity)