$s = 'Пользователь {user_240} сделал {action_32} а пользователь {user_123} сделал {action_554}! ';
preg_match_all ('~{(user|action)_(\d+)}~Ui',$s,$tmp);
print_r($tmp);
Array
(
[0] => Array
(
[0] => {user_240}
[1] => {action_32}
[2] => {user_123}
[3] => {action_554}
)
[1] => Array
(
[0] => user
[1] => action
[2] => user
[3] => action
)
[2] => Array
(
[0] => 240
[1] => 32
[2] => 123
[3] => 554
)
)
UPDATE table1
JOIN table2 on table2.fio=table1.fio and table2.address = table1.address
SET table1.phone = table2.phone