shadiadiph Posted April 26, 2009 Share Posted April 26, 2009 hi was just wondering if any one knows the regex for something like this ereq=8f98139853a8036ef952da5189d9921e4fcfd62b4bd2ce8af5103fdeedd848943ac1eb99de0766be07a6412243ce5a77f4e21fe9bbd0b96a537cbe611a800603c82caaae0c5a38018618b0387a973983b54a191f4982cfa88e37da3cf1038361861a6aa7fca70d6fb414110199de77baddbb6176b0d8a02d77629d92dc5e9397acc28d9187f524a9bd73b1984b3cf5eb6991a22ca4c0078a938114c85b8a01d6b56d9b652fd395eab8de8280c98bd86a795f5f5eef2520cc24490f9f9e8cfad4338e8a16d4c070a79fcdae580f11ba0f2218272f5467b6e19f9235e3edc98c4a49342e70c3427aafc6c12b97564ab3bc2280 Link to comment https://forums.phpfreaks.com/topic/155698-preg_match-regex-help/ Share on other sites More sharing options...
Mchl Posted April 26, 2009 Share Posted April 26, 2009 To match what? Link to comment https://forums.phpfreaks.com/topic/155698-preg_match-regex-help/#findComment-819524 Share on other sites More sharing options...
shadiadiph Posted April 26, 2009 Author Share Posted April 26, 2009 its there its one line long here it is again 8f98139853a8036ef952da5189d9921e4fcfd62b4bd2ce8af5103fdeedd848943ac1eb99de0766be07a6412243ce5a77f4e21fe9bbd0b96a537cbe611a800603c82caaae0c5a38018618b0387a973983b54a191f4982cfa88e37da3cf1038361861a6aa7fca70d6fb414110199de77baddbb6176b0d8a02d77629d92dc5e9397acc28d9187f524a9bd73b1984b3cf5eb6991a22ca4c0078a938114c85b8a01d6b56d9b652fd395eab8de8280c98bd86a795f5f5eef2520cc24490f9f9e8cfad4338e8a16d4c070a79fcdae580f11ba0f2218272f5467b6e19f9235e3edc98c4a49342e70c3427aafc6c12b97564ab3bc2280 just numbers and letters lower and upper with no spaces Link to comment https://forums.phpfreaks.com/topic/155698-preg_match-regex-help/#findComment-819540 Share on other sites More sharing options...
Mchl Posted April 26, 2009 Share Posted April 26, 2009 any number (including zero) of hexadecimal digits preg_match("/[0-9A-Fa-f]*/",$string,$match); one or more hexadecimal digits preg_match("/[0-9A-Fa-f]+/",$string,$match); exactly 484 hexadecimal digits preg_match("/[0-9A-Fa-f]{484}/",$string,$match); Link to comment https://forums.phpfreaks.com/topic/155698-preg_match-regex-help/#findComment-819542 Share on other sites More sharing options...
thebadbad Posted April 26, 2009 Share Posted April 26, 2009 If you want to check if a string contains only alphanumeric characters: ctype_alnum(). Link to comment https://forums.phpfreaks.com/topic/155698-preg_match-regex-help/#findComment-819543 Share on other sites More sharing options...
shadiadiph Posted April 26, 2009 Author Share Posted April 26, 2009 thanks Mchl thats a great help I am using it in a Curl function Link to comment https://forums.phpfreaks.com/topic/155698-preg_match-regex-help/#findComment-819551 Share on other sites More sharing options...
shadiadiph Posted April 27, 2009 Author Share Posted April 27, 2009 mm still having a problem with this on I keep getting the error Undefined offset 0 in /html/etc I get a link has moved to page and the code to confirm it is login.main?ereq=8f98139853a8036ef952da5d253d56567a877b5d5ca9f6e27a61529e08f2cd5d3c93bc3a2dc375b540d45609466d6094e87053e0033176410d45c17e0118569151e64211d8449e5f42c39e561609f70dc5962ad08675930b4276b23efd3d35861d26c2ea5ef3ad631f15125f3001b684a70b36bbc19ad05cf31230fb9c809292edacb699d0d2881b65bd44dca416055cb022384252019f359f0425ad30af13f6695e02e8ea837710e9665094b37e94a5f7cb817c2268a2144b5ff846fe1d925084c797385afb5c444404abb87e3fecdf76779607bce5fda849e041047e70b75575c04e1e935780872dd6d823b982c20cfd52">here</A>.<P> so I am trying to pregmatch the value of ereq= what i have tried is this which sometimes returns the value with ereq= this is what i have why isn't it working? $html = curl_exec($ch); $matches = array(); preg_match('/ereq\=[0-9A-Fa-f]+/',$html,$matches); $confirmlink = $matches[0]; $url3 ="http://website.com/login.main?'.$confirmlink.'"; curl_setopt($ch, CURLOPT_URL, $url3); $html = curl_exec($ch); print $html; [code] Link to comment https://forums.phpfreaks.com/topic/155698-preg_match-regex-help/#findComment-819958 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.