anchor.diff:      ?FORALL(Byte, byte(),
               match =:= re2:match([Byte], "^.*", [{capture, none}])).
   
  -valid_string() -> non_empty(list(oneof([unicode_char(), unicode_binary()]))).
  -
   binary_str(Str) -> unicode:characters_to_binary(Str).
   
   prop_char() ->
  
positive.code: is_substr(Str1, Str2) ->
      nomatch =/= binary:match(Str1, Str2).
  
  value_spec() -> oneof(['all',
                         'all_but_first',
                         'first',
                         'none',
                         value_spec_list()]).
  value_spec_list() -> non_empty(list(value_spec_id())).
  value_spec_id() -> oneof([non_neg_integer(), atom(), valid_string()]).
  valid_match_option(Str) ->
      oneof(['caseless',
             {'offset', choose(1,length(Str))},
             {'capture', value_spec()},
             {'capture', value_spec(), oneof(['index','binary'])}
            ]).
  
  random_re_tuple() ->
      ?LET({Str, RE}, {oneof(?STRINGS), oneof(?REGEXES)},
           ?LET(Opts, list(valid_match_option(Str)),
                {Str, RE, Opts})).
  
  
negative.code:               end, Opts).
  
  compile_option() ->
      elements(['caseless', {'max_mem', non_neg_integer()}]).
  
  prop_compile() ->
      ?FORALL({RE, Opts}, {elements(?REGEXES),
                           ?LET(Opts, list(compile_option()),
                                sanitize_max_mem(Opts))},
              {ok, <<>>} =:= re2:compile(RE, Opts)).
  
  replace_options() ->
      elements([[], ['global']]).
  
  prop_replace() ->
      ?FORALL({Str,RE,Replacement,Opts},
              {?LET(S, elements(?STRINGS), binary_str(S)),
               elements(?REGEXES),
               ?LET(S, unicode_string(), binary_str(S)),
               replace_options()},
              ?IMPLIES(not is_substr(Str, Replacement),
                       begin
  