atlanta Posted April 17, 2008 Share Posted April 17, 2008 Hey i needed a little help with selecting the stuff in between this code using the preg_match function . i dont know how to right the expression correctly to get the stuff in between the table table table { and } table table table { border-style:solid; border-width:1px; border-color:A47040; background-color:EEE3CF; } So i would want the regex function to return border-style:solid; border-width:1px; border-color:A47040; background-color:EEE3CF; could someone help me out with writting the expression correctly thanks Link to comment https://forums.phpfreaks.com/topic/101467-preg_match-help/ Share on other sites More sharing options...
marcus Posted April 17, 2008 Share Posted April 17, 2008 i'm not the best at regex but <?php $string = "table table table { border-style:solid; border-width:1px; border-color:A47040; background-color:EEE3CF; }"; $pattern = "/table table table {(.*?)}/is"; $woo = preg_match_all($pattern, $string, $style); echo nl2br($style[1][0]); ?> my results: border-style:solid; border-width:1px; border-color:A47040; background-color:EEE3CF; Link to comment https://forums.phpfreaks.com/topic/101467-preg_match-help/#findComment-519039 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.