In this example i'm scanning a css file for colour hash codes...
$match='/(#[a-f0-9]{3,6})/is'; // matches colour hashes from 3 to 6 in length
preg_match_all($match, $s, $a, PREG_PATTERN_ORDER);That works ok for now, what i'm after is how once matched as above how to get some text from before the mmatch returned as a seperate group.
Example css:
At the moment i'm just returned "#fff" and "#000", what i'm after is ("#fff","body") and ("#000","a"). So basically after match come back to before "{" and either to start of file or next "}".
Any help please?