you don\'t really need th $allowedcaps. You can just have a local variable. And you should use $regex as napa said. Really nice work BytchAmy. =)