I often find that it takes longer to debug REGEX solutions than it does to write simpler code. Nothing wrong with REGEX, but a language made up of nothing but punctuation is very hard to get right. Going forward, you might want to package this code into a function. You feed the function a string and it returns the array. Then in your mainline code, all you would need to write is a single line, something like:

Featured Post

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Introduction
Many web sites contain image galleries; a common design for these galleries includes a page with a collection of thumbnail images. You can click on each of the thumbnail images to see the larger version of the image. This is easily i…

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption. Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…

Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…