# wp-optimize/4.7.0/vendor/matthiasmullie/minify/src/Exceptions/PatternMatchException.php

WP-Optimize – Cache, Compress images, Minify &amp; Clean database to boost page speed &amp; performance, version 4.7.0. 37 lines.

- Page: https://pluginprobe.com/plugins/wp-optimize/4.7.0/code/vendor/matthiasmullie/minify/src/Exceptions/PatternMatchException.php
- Raw: https://pluginprobe.com/plugins/wp-optimize/4.7.0/raw/vendor/matthiasmullie/minify/src/Exceptions/PatternMatchException.php
- Modified: 2025-07-16T14:37:22+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/wp-optimize/4.7.0/code/vendor/matthiasmullie/minify/src/Exceptions/PatternMatchException.php#L10-L20`.

```php
<?php

/**
 * Pattern match exception.
 *
 * Please report bugs on https://github.com/matthiasmullie/minify/issues
 *
 * @author Ere Maijala <ere.maijala@helsinki.fi>
 * @copyright Copyright (c) 2012, Matthias Mullie. All rights reserved
 * @license MIT License
 */

namespace MatthiasMullie\Minify\Exceptions;

/**
 * Pattern Match Exception Class.
 *
 * @author Ere Maijala <ere.maijala@helsinki.fi>
 */
class PatternMatchException extends BasicException
{
    /**
     * Create an exception from preg_last_error.
     *
     * @param string $msg Error message
     */
    public static function fromLastError($msg)
    {
        $msg .= ': Error ' . preg_last_error();
        if (PHP_MAJOR_VERSION >= 8) {
            $msg .= ' - ' . preg_last_error_msg();
        }

        return new PatternMatchException($msg);
    }
}

```
