Here is my PHP code. I'm needing a regular expression to get my desired output.
$str = 'abc:123,phoneNumber:631 741-4498, fdsfdsf, hgjhtg,juiy';
Expected Output: 631741-4498
$str = 'abc:123,phoneNumber:+123 423, fdsfdsf, hgjhtg,juiy';
Expected Output: +123 423
$str = 'abc:123,phoneNumber:+(123) 423-727, fdsfdsf, hgjhtg,juiy';
Expected Output: +(123) 423-727
Here's what I've tried
$str = 'abc:123,phoneNumber:631 741-4498, fdsfdsf, hgjhtg,juiy';
$str = str_replace(" ","",$str);
preg_match('/phoneNumber:\s*(.*)/', $str, $matches);