I want to have a regular expression that accepts these forms :
23456KW33C3
23456KW33
23456K
23456
23456W33C3
23456W33
I wrote these two regex
/(?i)^2\d{4}K?(M|(W33)(C3)?)?$/i
/(?i)^2\d{4}K?(M|(W33)|(W33C3))?$/i
They accepts all forms but not 23456KW33C3
!!!
I use it in if expression :
if (preg_match('/(?i)^2\d{4}K?(M|(W33)(C3)?)?$/i' ,$text))
What's wrong with them ?