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 ? 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. 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 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 Link to comment https://forums.phpfreaks.com/topic/190471-regular-expression/#findComment-1005198 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.