anchor.diff:  is_str_integer(S) -> string_in_ranges(S, [{$0, $9}]).
   is_str_alpha(S) -> string_in_ranges(S, [{$A, $Z}, {$a, $z}]).
   is_str_alnum(S) -> string_in_ranges(S, [{$0, $9}, {$A, $Z}, {$a, $z}]).
  -is_str_printable(S) -> string_in_ranges(S, [{32, 126}, {160, 255}]).
  +is_str_printable(S) -> string_in_ranges(S, [$\r, $\n, $\t, {32, 126}, {160, 255}]).
   
   %% check that string consists of chars that fit in the given ranges
   string_in_ranges([],_Ranges)   -> true;
  
positive.code:         true  -> string_in_ranges(L, Ranges)
      end.
  
  %% check that char C is in one of the ranges spec'd as [{Min, Max}].
  char_in_ranges(_C, []) -> false;
  char_in_ranges(C, [{Min, Max} | _]) when C >= Min, C =< Max -> true;
  char_in_ranges(C, [{_Min,_Max} | Rest]) -> char_in_ranges(C, Rest).
  
  %% order of magnitude for integers and floats
  mag(X, N) -> trunc(math:log10(abs(X))) div N * N.
  
negative.code: char_in_ranges_test() ->
      ?assertNot(char_in_ranges($A, [])),
      ?assertNot(char_in_ranges($A, [{$a, $z}])),
      ?assertNot(char_in_ranges($\n, [{$a, $z}])),
      ?assert(char_in_ranges($\n, [{$a, $z}, $\n])),
      ?assert(char_in_ranges($A, [{$A, $Z}])),
      ?assert(char_in_ranges($A, [{$A, $Z}, {$a, $z}])).
  