jones jones - 1 year ago 64
PHP Question

PHP how to get string between the last nested `(` , and `)`?

I have some mysql statement like bellow:

GROUP_CONCAT(CONCAT_WS("=",DATE_FORMAT(ca.`date`,'%Y-%m-%d'),sa.`precence`)) as attendence

Above statement is a sample, what i would to do is, to take every thing between the last nested parentheses
How to do that with regex or another ways ?

Answer Source

You can try this regex /(\([^\(\)]+\))/


Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download