$re = '/\b(?:G,C,D|A,B,C|E,C,D)|(?:[ABCDEFG](?:#|b)?)(?:\/[ABCDEFG]b)?(?:(?:(?:maj|min|sus|add|aug|dim)(?:\d{0,2}(?:#\d{1,2}|sus\d)?)?)|(?:m\d{0,2}(?:(?:maj|add|#)\d{0,2})?)|(?:-?\d{0,2}(?:\([^)]*\)|#\d{1,2})?))?/';
$str = '<p>Intro:G,C,D D, A, Em, Eb Ebb G G,C,D</p>
A,B,C <p><br />
Verse 1:</p> <p> D A Em <br />
Yeah I\'ve iced down a few thousand beers in my days<br />
G <br />
You put down twice as many<br /> D A Em <br />
C9 G C#/Db C# Dsus2sus4
Dmaj13#11
Bmaj13#11
A7(b5,#9)
A7#9
B-5
#sus #maj #min #aug';
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