cgchris99 Posted October 17, 2006 Share Posted October 17, 2006 Need to parse out this piece of code...-----------------------------------------------------------------theForm.action = 'Browse.aspx?MyAction=632966656416040865'; theForm.submit();-----------------------------------------------------------------What I need is the number after MyAction. But I can't get my code to work. It seems to have trouble with either the single quote or the semicolon. Here is what I have codedpreg_match_all("#MyToken=(.*?)/';#s",$page,$myaction);But this doesn't work. What do I have wrong?Thanks for any advice or help. Quote Link to comment Share on other sites More sharing options...
effigy Posted October 17, 2006 Share Posted October 17, 2006 MyToken should be MyAction and you don't need the forward slash. Quote Link to comment Share on other sites More sharing options...
cgchris99 Posted October 17, 2006 Author Share Posted October 17, 2006 That's an oops on my part. It actually is preg_match_all("#MyAction=(.*?)/';#s",$page,$myaction);But it still doesn't work. Quote Link to comment Share on other sites More sharing options...
printf Posted October 19, 2006 Share Posted October 19, 2006 [code]preg_match_all ( "!(?<=myaction=)\d+!si", $page, $myaction );[/code]results will be in$myaction[0];I do it this way, so you only return the data you want, no need for more arrays!me! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.