I'm struggling to find out how I can get the text after a regex match (until the end of word).
Ex 1:
Input: my home
Regex: /hom/
Result: e
Ex 2:
Input: soulful
Regex: /soul/
Result: ful
You can use:
$str = 'soulful';
$reg = '/soul(\w+)/';
if ( preg_match($reg, $str, $m) )
print_r ($m);
Array
(
[0] => soulful
[1] => ful
)