Arrays of strings from regex

From: Date: Tue, 31 Dec 2002 09:47:00 +0000
Subject: Arrays of strings from regex
Groups: php.general 
Request: Send a blank email to php-general+get-129752@lists.php.net to get a copy of this message
Am working through document to collect pieces that match and then insert them into an array so they can be used to construct another file. Looking in my doc for lines like this: {\*\cs43 \additive \sbasedon10 db_edition;} {\*\cs44 \additive \sbasedon10 db_editor;} {\*\cs45 \additive \sbasedon10 db_email;} Wrote this regex to find them: ^\{\\\*\\?(cs[0-9]{1,3}) (.*)\\[a-z0-9]+ (.*);\}$ Now looking for best method for getting the parts in parenthesis () into an array so it will contain these values by finding the above three lines: $matches [0][0][0] = cs43 , \additive \sbasedon10, db_edition $matches [1][1][1] = cs44 , \additive \sbasedon10, db_editor $matches [2][2][2] = cs45 , \additive \sbasedon10, db_email Thanks in advance for any pointers.

« previous php.general (#129752) next »