Code: Select all
preg_match('#id="__VIEWSTATE" value="(.*?)"#', $content, $matches);Code: Select all
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/1123ASdlotsandlotsandlotsofgarbage=" />Moderator: General Moderators
Code: Select all
preg_match('#id="__VIEWSTATE" value="(.*?)"#', $content, $matches);Code: Select all
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/1123ASdlotsandlotsandlotsofgarbage=" />I am not aware of a limitation. Note that the DOT by default does not match new line characters, perhaps there are new line characters in your long value? Try to replace "(.*?)" with "([^"]*)".shiznatix wrote:I have a very simple regex to grab a form field value after grabbing the page via curl. Here is my regex:and here is my field that I want the value from:Code: Select all
preg_match('#id="__VIEWSTATE" value="(.*?)"#', $content, $matches);Now the value there is a made up one because the real one is 107076 long on average (seriously). Now this value can have everything from / A-Z 0-9 = + ... whatever they want so that is why I am using the (.*?) to just grab anything there. My regex seams to do just fine if I replace the super long value with just something short so I am starting to think that there is some sort of character limit set to what can be returned there. Is this true and if not, why would my regex not be working? If you want me to post a real whole value="" part then no problem, just is so long I didn't want to make it such a spammy post.Code: Select all
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/1123ASdlotsandlotsandlotsofgarbage=" />
Good to hear it!shiznatix wrote:ah that was it, thanks hommie.