I get the page content through CURL and skip through the htmlspecialchars function. At the output of a large amount of code, so I will indicate the desired section:
<script type=\"text\/javascript\" src=\"http:\/\/{domain}\/search.js?p=&query=Hlo9oDDbbm4{ch}&keywords=phone\"><\/script> I put the code above in the $text variable and try to get the value of Hlo9oDDbbm4 :
preg_match("/search.js?p=&query=(.*?){ch}&keywords=phone/",$text,$matches); echo $matches[1]; but nothing comes out of me. How to make a regular expression?
s?in your expression means the presence or absence of the letters. The question mark itself is not expected in the line. We must put in front of him a backslash that he would have meant himself. But since you have a string in double quotes, then you need to double backslash i.\\.js\\?- Mike