Hello, I'm trying to pull off the url's within the sorce of my $string below using preg_match_all. I'm currently using:
Basically, each url will start with http://latex.codecogs.com/gif.latex?, but then all bets are off. I think that my regex is correct up through ((.^\")*) which is my attempt at saying "Hey, look for any pattern here except for a quote and then find the final quote. Unfortunately, nothing is found. Any thoughts?PHP Code:$string = '<p>Id like to add this stuff here: <img src="http://latex.codecogs.com/gif.latex?x^2&plus;3x-4" alt="x^2+3x-4" /> is one such formula and ‚another formula is <img src="http://latex.codecogs.com/gif.latex?\frac{a}{b}" alt="\frac{a}{b}" /> this one. </p>';
preg_match_all('/"http:\/\/(latex.codecogs.com)\/(gif|svg|png)\.latex\?((.^\")*)"/', $string, $https, PREG_SET_ORDER);
Thank you,
Eric



Reply With Quote


Bookmarks