Hi,
I am using a regex (see below) to find a particular input tag on an HTML page. I want to find a tag with value="myvalue" ahead of the name="myname". I have [>]*? in the regex to allow the engine to scan up to the end of each tag and fail there.
Unfortunately, the engine is finding a value= several tags ahead of the one with name="myname" and is gobbeling up all of the characters in between, matching characters spaning several tags.
The scan is passing several ">" characters and does not care.
Here is my regex:
\s?<input[>]?name="myname"[>]?value=".?"[>]?>
Here is an example of the target HTML
<input type="checkbox" name="forgotPassword" value="checkbox">
</font></p>
<p align="left"><font size="-1" face="Arial, Helvetica, sans-serif">Email
Address:
<input type="text" name="loginEmail" >
==============================
insteading of failing to mach ( which I thought should happen, the regex is matching everything from the value= up to the end of the string.
I am using preg_match() and have the s option endbled to allow the scan to span newlines. ( I do not want to loose the s option )
So how do I make the regex fail if it scans to a ">" character before it gets to "name=" ?
Thanks in advance,
Tony