i trying select every query select in start , limit in end, example: $selquery = "select disticnt c.firstname,c.lastname,c.id clientid,qc.category_name,qr.cid,qr.catid,qr.rhid cms_question_report qr, cms_clients c,cms_questioncategory qc ,cms_reporthistory rh c.id=qr.cid , qr.rhid=rh.id , qr.catid='".$objarray['catid']."' , qr.catid=qc.id , c.id in($selclids) limit $page_no,$this->limit"; and not select other query doesn't contain limit. regex thought work this: select .*\n* limit where i'm stating has start "select" other characters , ends limit, issue don't know how handle \n*, have multiple unknown number of new lines , in each line there unknown characters, i'm assuming should go \n*. \n .* , on, there way can select character including new line. i have tried using s...