I want to match the pattern below and obtain the word target.
INPUT TYPE=”HIDDEN” NAME=”TITLE” VALUE=”target “>
I try this but in vain.
preg_match('@(?:<INPUT TYPE="HIDDEN" NAME="TITLE" VALUE=")(.*)(?:">)@',$data,$matches);
I think the problem is because of double quote
I also try \” but still fail…
It fails simply because you have a double space in your pattern in here (marked with
_):Remove one space there and it works, anyway here would be my attempt from scratch, case insensitive and either with
"or'though I’m not sure if it’s part of what you want thatnamehas to betitlein which case I’d have to edit it a bit.