fzaninotto/Faker — pull request #453 by fzaninotto (2014-11-07 08:07:40+00:00)
Title: Add regexify formatter

Transforms a basic regular expression into a random string satisfying the expression.

```php
$faker->regexify('[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}'); // sm0@y8k96a.ej
```

Regex delimiters '/.../' and begin/end markers '^...$' are ignored.

Only supports a small subset of the regex syntax. For instance, unicode, negated classes, unbouned ranges, subpatterns, back references, assertions, recursive patterns, and comments are not supported. Escaping
support is extremely fragile.

This method is also VERY slow. Use it only when no other formatter can generate the fake data you want. For instance, prefer calling `$faker->email` rather than `regexify` with the previous regular expression.

Also note than `bothify` can probably do most of what this method does, but much faster. For instance, for a dummy email generation, try `$faker->bothify('?????????@???.???')`.

See [icomefromthenet/ReverseRegex](https://github.com/icomefromthenet/ReverseRegex) for a more robust implementation.