$re = '/\[(?<prefix>.*:)?\s*(?<expr>((?<left>.*?)\s*(@|[Dd][Cc])\s*(?<test>(?<right>.*?)\]))|(?<data>.*)\]\s*(?=\())\s*(\((?<fail>(.*?))\/(?<pass>.*?)\))?/m';
$str = '[Prevent Fall (1min): STR DC 12](swept downstream to [room L]/able to reach edge)
[Hide DC 12] to escape the run
[Hide@12] to escape the run
[1 min: Armor Rating DC STR-5](swept downstream to [room L]/able to reach edge)
[Hide 12] to escape the run
[Room L]
[1min: STR DC 12](swept downstream to [room L]/able to reach edge)
[1 min: STR-Armor Rating DC 5](swept downstream to [room L]/able to reach edge)
[12 hr: STR@12](swept downstream to [room L]/able to reach edge)
How does one [WIS@15](fail info/pass info 1)
[ssdsd + 22](i\'m failing/oh good)
[ssdsd](-/ds)
[ssdsd](player is Incapacitated for 1d4 rounds/-)
[Con](sleep for 1d6x10 minutes/-)
[Dex](2d6 damage/half)
[CON](lose 1hp every minute/-)
[STR](-/upward thrust dislodges debris - critical: door opens)
[DEX](slide down to pit/-)
[level 2 - room T]
[CON-Armor Rating](1d8 damage/-)
[STR-Armor Rating](swept downstream to [room L]/able to reach edge)
[Dex](-/pull up bracelet with chain)
[paralyze](paralyzed 3d6 turns/-)
[wis](cannot understand/-)
[poison](unconscious 1d6 turns/-)';
preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0);
// Print the entire match result
var_dump($matches);
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for PHP, please visit: http://php.net/manual/en/ref.pcre.php