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
Due to how this library's algorithm works, look-arounds cannot be supported. As explained in the README, a RegexpExamples::IllegalSyntax will be raised if they are used in a pattern you attempt to generate examples for.
However, similar to how the library currently "ignores" \G. ^ and \A anchors at the beginning of a pattern; or $, \z and \Z at the end; it would also be safe to ignore empty look arounds!
For example, the following could be considered safe:
/foo|bar(?=)/.random_example #=> "foo"
One motivation for this stems from the fact that Regexp.union returns an empty look-ahead if no patterns are given:
Regexp.union([]) #=> /(?!)/
Therefore one would expect the following to work as follows, rather than raising an exception:
Regexp.union([]).random_example #=> ""
The text was updated successfully, but these errors were encountered:
Due to how this library's algorithm works, look-arounds cannot be supported. As explained in the README, a
RegexpExamples::IllegalSyntax
will be raised if they are used in a pattern you attempt to generate examples for.However, similar to how the library currently "ignores"
\G
.^
and\A
anchors at the beginning of a pattern; or$
,\z
and\Z
at the end; it would also be safe to ignore empty look arounds!For example, the following could be considered safe:
One motivation for this stems from the fact that
Regexp.union
returns an empty look-ahead if no patterns are given:Therefore one would expect the following to work as follows, rather than raising an exception:
The text was updated successfully, but these errors were encountered: