While I know how to tell if a string matches a pattern, what I want is to get certain portions of the string back in an array. For example:

pattern: 'catalog/[0-9]+/entry/[0-9]+/edit'
string: 'catalog/12/entry/45/edit'

What I need to get is the values of each variable block in order to use them:

array(12, 45)

How would I go about doing this? preg_match just returns the entire string. Sorry I am such a dunderhead when it comes to regex. =/