forked from fzaninotto/Faker
-
Notifications
You must be signed in to change notification settings - Fork 425
Closed
Labels
Description
Summary
In some cases, like [a-z\-]{4} the slash in regex should be ignored. At least if we want to simulate php behavior. Currently, slash considered a valid character and «presents» in generated strings.
Versions
| Version | |
|---|---|
| PHP | 8.0.8 |
fakerphp/faker |
1.1.16 |
Self-enclosed code snippet for reproduction
for ($i = 0; $i<100; $i++) {
$v = \Faker\Factory::create()->regexify('[a-z\-]{4}');
if (strlen($v) < 4) {
var_dump($v);
}
}Expected output
Actual output
It fails in 7-10% of iteration in my setup. Producing output like
...
string(3) "srb"
string(3) "ncs"
...Reactions are currently unavailable