With xp-framework/xp-framework@a0b1e39, you can now use this:

```php
$matcher= new PatternMatcher(\text\regex\Pattern::compile('^foo'));
```