I need some help to come up with a pattern matching expression. I need to process some HTML content and change one specific HTML tag: <input>
So I open the HTML file and place the content into an array. This is part of the array (HTML content) I need to process.
So I want to change this (example):
So I want to change this
Process:
1. Grab the input name ("state").
2. Strip the entire <input> tag (from "<input" to "/>".
3. Echo a string that will have the same name as the input name (input name="state" to $state). P.S. The matching strings are all defined.
Any help would be really appreciated.
So I open the HTML file and place the content into an array. This is part of the array (HTML content) I need to process.
So I want to change this (example):
Code:
<input type="text" name="state" size="32" maxlength="32" value="" />
So I want to change this
Code:
${state}
Process:
1. Grab the input name ("state").
2. Strip the entire <input> tag (from "<input" to "/>".
3. Echo a string that will have the same name as the input name (input name="state" to $state). P.S. The matching strings are all defined.
Any help would be really appreciated.