Extracting subnet in php from a string
===

i am using this code to extract the ip from a string
    preg_match( '/(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})/', '192.168.1.1', $right)
    echo $right;
now if i want to extract a subnet mask from a string like for example 192.168.1.1/12
then what to do with the pregmatch?