I\'m having a small issue with my Laravel rules and regex operation :
Basically a rule is an array as such :
\'room\'=>\'required|alpha_num|min:2|
You should use an array instead of separating rules using |:
array
|
'cid' => array('required', 'regex:/^((comp)|(soen)|(engr)|(elec))\d{3}$/i')
The pipe (|) sigh is available in your regular expression pattern so it's conflicting with the separator. Other answer already stated it.