Page 1 of 1

Regex to Find All Checkboxes

Posted: Tue Nov 09, 2010 2:06 pm
by tommyready
Hey everyone,

I'm having some problem with regex and replacing certain content. All my forms are stored in a field of a table and so when they are queried they all have a checkbox next to a field if it is required. I want to find all checkboxes and replace them with either <em>*</em> or '' (blank space).

Here is what I'm trying to make work.

Code: Select all

preg_replace('/<input(.*?)id="(.*?)-required" type="checkbox"(.*?)>/','',$Content);
It cant find a match I'm guessing but I am lost as to why though. Any help would be great.

Re: Regex to Find All Checkboxes

Posted: Wed Nov 10, 2010 6:13 am
by klevis miho
Show us some code of how the input checkboxes are made of.