[Solved] RegEx to determine if string is score [closed]


This will match a number, followed immediately by a hyphen, followed immediately by another number, allows for multi-digit numbers, and has groups to give you each of the scores.

preg_match('/([0-9]+)\-([0-9]+)/', $string, $match); 

That should work for you.

1

solved RegEx to determine if string is score [closed]