Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Support case-insenstive regexes

  • Loading branch information...
commit 277c6d75c996151f9655575dee6f25206dc1de57 1 parent 5d08791
@evanmiller evanmiller authored
Showing with 10 additions and 6 deletions.
  1. +10 −6 src/db_adapters/boss_db_adapter_mnesia.erl
View
16 src/db_adapters/boss_db_adapter_mnesia.erl
@@ -132,12 +132,16 @@ test_rec(Rec,{Key, 'le', Value}) ->
test_rec(Rec,{Key, 'matches', Value}) ->
{ok, MP} = re:compile(Value),
case re:run(apply(Rec,Key,[]), MP) of
- {match,_} ->
- true;
- match ->
- true;
- _ ->
- false
+ {match,_} -> true;
+ match -> true;
+ _ -> false
+ end;
+test_rec(Rec,{Key, 'matches', "*"++Value}) ->
+ {ok, MP} = re:compile(Value, [caseless]),
+ case re:run(apply(Rec,Key,[]), MP) of
+ {match,_} -> true;
+ match -> true;
+ _ -> false
end;
test_rec(Rec,{Key, 'not_matches', Value}) ->
not test_rec(Rec,{Key, 'matches', Value});
Please sign in to comment.
Something went wrong with that request. Please try again.