<?php

$string = 'Diego:25:RJ';

preg_match('/(?P<nome>\w+):(?P<idade>\d+):(?P<estado>\w+)/', $string , $matches );

echo $matches['nome'] . "\n";
echo $matches['idade'] . "\n";
echo $matches['estado'] . "\n";
