-
-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cyrillic characters don't work #93
Comments
The default range for sets includes only printable ASCII characters https://github.com/fent/randexp.js#default-range you can change it with something like the following RandExp.prototype.defaultRange.add(0, 65535); or with instances let randexp = new RandExp(/regex/);
randexp.defaultRange.add(0, 65535);
whether or not it's applied to custom sets is debatable, it does seem like unexpected behavior. |
I can understand the default range being used for any "open' sets, such as |
IMO this should be left as it is. People only need a minute of time to check the docs to understand what's going on. It makes no sense if I explicitly specify character range on Randexp and then see that my string does not follow the range I specified. A regular expression may come from anywhere; a Randexp instance is what I control and use and want my generated string to be in range of. |
I'm leaning towards @michaelficarra in that the default range should be respected for predefined sets, but for custom non-negated sets like in the OP (e.g. |
Then why |
@1valdis That's ridiculous. If |
@michaelficarra if it was restricted by someone to |
Regular expressions with cyrillic characters (e.g.
[А-Я]{1,5}[а-я]{5,10}
) don't work in the latest version. The last version it used to work in is 0.4.6.This reproduces the issue: https://codesandbox.io/s/randexp-cyrillic-issue-2kcou
The text was updated successfully, but these errors were encountered: