The `preg_match` can be in the conditional:
```php
if (!preg_match(/* ... */)) {
    throw new /*...*/;
}
```
That makes the intent more clear and easy to understand.