substr() could be useful.
Here are some rules to color the ISBN as you want.
Maybe it's possible to make a not "advanced" versions of the rules, but in the meantime, this will do.
begins with 978 (ISBN-10 format 13)
Code:
program: test(strlen($#isbn)>10, cmp(substr($#isbn, 0, 3), 979, '', '#0af', ''), '')
begins with 979 (ISBN-13)
Code:
program: test(strlen($#isbn)>10, cmp(substr($#isbn, 0, 3), 978, '', '#f00', ''), '')
other isbn (ISBN-10 old format)
Code:
program: test($#isbn, '#5a7', '')
Note: important to put the rule "other isbn"
after the others, otherwise all ISBN will be green.