Regex to Find All Checkboxes
Posted: Tue Nov 09, 2010 2:06 pm
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.
It cant find a match I'm guessing but I am lost as to why though. Any help would be great.
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);