- $matched = preg_match_all( $regex, $text, $matches, PREG_SET_ORDER );
- if ( $matched === false ) {
- throw new Exception( __METHOD__ . ': preg_match_all returned false' );
- }
- if ( $matched ) {
+ $res = preg_match_all( $regex, $text, $matches, PREG_SET_ORDER );
+ if ( $res === false ) {
+ LoggerFactory::getInstance( 'parser' )->warning( 'preg_match_all returned false', array(
+ 'code' => preg_last_error(),
+ 'regex' => $regex,
+ 'text' => $text,
+ ) );
+ } elseif ( $res ) {