Q:

Regex Search Help

Given a string such as:  
a:2:{i:0;s:1:"1";i:1;s:1:"2";}

I want to find every integer within quotes and create an array of all integers found in the string.
End result should be an array like:  
Array
(
    [0] => 1
    [1] => 2
)

I'm guessing you use preg_match() but I have no experience with regular expressions :(

A:

How about this:
 $str = 'a:2:{i:0;s:1:"1";i:1;s:1:"2";}';
 print_r(array_values(unserialize($str)));

Not a regex, same answer.
This works because the string you have is a serialized PHP array. Using a regex would be the wrong way to do this.

