Help to create a regular expression that will check the data for compliance with the following structure: text, (comma), numbers

Example: Moscow, 101100

if (...) { die('success'); } else { die('error'); } 

    1 answer 1

    The code wrote "on the knee", you may need an adjustment:

     $str = 'Москва,101100'; $patt = '~\pL+,\d+~u'; if (preg_match($patt, $str)) { die('success'); } else { die('error'); }