I want to match item id,looks like:
a1234...
b5678...
c9876...
...
How can I write a regex only match first five characters
and first is alphabet letter, 2-5 is integer number
I want to match item id,looks like:
a1234...
b5678...
c9876...
...
How can I write a regex only match first five characters
and first is alphabet letter, 2-5 is integer number
preg_match_all('/[a-z]\d{2,5}/', $subject, $result, PREG_PATTERN_ORDER);
for ($i = 0; $i < count($result[0]); $i++) {
# Matched text = $result[0][$i];
}