Add PHP magic method `__toString` for easier `preg_match` usage.

Feature added by https://github.com/BlaineSch