<?
header('Content-type: text/plain');
$string = 'This string has <i>two</i> places with <i>italics</i> tags';
$regex = '/<i>([<]*)<\/i>/';
preg_match_all($regex, $string, $matches, PREG_PATTERN_ORDER);
print_r($matches);
?>
The result is not exactly what you wanted, because $matches is an array of arrays. $matches[1] is what you want.
print_r($matches) yields:
Array
(
[0] => Array
(
[0] => <i>two</i>
[1] => <i>italics</i>
)
[1] => Array
(
[0] => two
[1] => italics
)
)
print_r($matches[1]) yields what you wanted,
Array
(
[0] => two
[1] => italics
)
The key in the regex is the parenthesized subexpression ([<]*), which says "match any number of any characters other than a left angle bracket." The overall match is considered expression 0, and the parenthesized match is expression 1.