Q:

codeigniter regex_match matching for 'two length values'

I have this regex_match like - 
    regex_match[/^[0-9]{13}$/ ] 

It validates all 13-digit integers. But I can't seem to find a way for allowing only 10-digit and 13-digit integers to pass as input. I tried all kinds of code like 
    regex_match[/^[0-9]{13|10}$/ ] ,

    regex_match[/^[0-9]{13}{10}$/ ] 

and even
    regex_match[/^[0-9]{13}$/ ] | regex_match[/^[0-9]{10}$/ ]

but none of them is working. 
How can I achieve this ?

A:

Check this..This is tested.. 
$number="12541254192";
    if( preg_match('/^([0-9]{13}|[0-9]{10})$/', number)==1){
        echo "Matching";
    }else{
        echo "Not Matching";
    }

