You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This means that Re.Pcre.regexp will accept arguments like [9-0] - which will be automatically converted to [0-9]. This is inconsistent with perl's behavior, e.g:
$ echo 1 | perl -pe 's/[0-9]/foo/'
foo
$ echo 1 | perl -pe 's/[9-0]/foo/'
Invalid [] range "9-0"in regex; marked by <-- HERE in m/[9-0 <-- HERE ]/ at -e line 1.
(I'm not very familiar with the code-base, but it seems like another potential place that this could be addressed is when perl.ml parses character-classes, by adding some validation before creating a range)
This is a pretty minor bug, but can result in confusing behavior for typos like [0- 9] - which Re.Pcre.regexp will parse happily.
The text was updated successfully, but these errors were encountered:
Cset.seq
compares its two arguments and, if the first argument is greater than the second argument, reverses their order: https://github.com/ocaml/ocaml-re/blob/master/lib/cset.ml#L74This means that
Re.Pcre.regexp
will accept arguments like[9-0]
- which will be automatically converted to[0-9]
. This is inconsistent with perl's behavior, e.g:(I'm not very familiar with the code-base, but it seems like another potential place that this could be addressed is when perl.ml parses character-classes, by adding some validation before creating a range)
This is a pretty minor bug, but can result in confusing behavior for typos like
[0- 9]
- whichRe.Pcre.regexp
will parse happily.The text was updated successfully, but these errors were encountered: