alin19 Posted January 31, 2010 Share Posted January 31, 2010 preg_match_all("/<a\sclass=\"BoldLightBlue\".+>(.+)<\/a>/",$match[1],$tables); i have this code but it gets me the data ntill the last <\/a> in the text ; how can i tell him to search until the first <\/a> is found ? Quote Link to comment https://forums.phpfreaks.com/topic/190471-regular-expression/ Share on other sites More sharing options...
cags Posted January 31, 2010 Share Posted January 31, 2010 Put a question mark after the + to make it a lazy quantifier. Quote Link to comment https://forums.phpfreaks.com/topic/190471-regular-expression/#findComment-1004756 Share on other sites More sharing options...
JAY6390 Posted February 1, 2010 Share Posted February 1, 2010 better still use the DOM to find all links and filter out the ones without the BoldLightBlue class Quote Link to comment https://forums.phpfreaks.com/topic/190471-regular-expression/#findComment-1004810 Share on other sites More sharing options...
alin19 Posted February 1, 2010 Author Share Posted February 1, 2010 Put a question mark after the + to make it a lazy quantifier. thanks Quote Link to comment https://forums.phpfreaks.com/topic/190471-regular-expression/#findComment-1005198 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.