jd2007 Posted October 9, 2007 Share Posted October 9, 2007 this is the regex: |(\\(.*?\\))| this is the string : (xy)aaa(ab)hh Link to comment https://forums.phpfreaks.com/topic/72465-how-to-modify-the-regex-below-to-get-match-the-first-braces-in-the-string/ Share on other sites More sharing options...
MadTechie Posted October 9, 2007 Share Posted October 9, 2007 wrong section but here <?php if (preg_match('/(\(.*?\))/i', $data, $regs)) { $result = $regs[1]; } else { $result = ""; } ?> Link to comment https://forums.phpfreaks.com/topic/72465-how-to-modify-the-regex-below-to-get-match-the-first-braces-in-the-string/#findComment-365385 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.