From fffe3cbb873936f469b2096fb4c89e4f83518b98 Mon Sep 17 00:00:00 2001 From: Alexandru Scvortov Date: Fri, 9 Jul 2010 12:11:22 +0100 Subject: replaced regexp with re --- src/rabbit_access_control.erl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/rabbit_access_control.erl') diff --git a/src/rabbit_access_control.erl b/src/rabbit_access_control.erl index 7d1839bb..9590d380 100644 --- a/src/rabbit_access_control.erl +++ b/src/rabbit_access_control.erl @@ -172,9 +172,10 @@ check_resource_access(Username, [] -> false; [#user_permission{permission = P}] -> - case regexp:match( + case re:run( binary_to_list(Name), - binary_to_list(element(permission_index(Permission), P))) of + binary_to_list(element(permission_index(Permission), P)), + [{return, list}]) of {match, _, _} -> true; nomatch -> false end @@ -301,7 +302,7 @@ list_vhosts() -> validate_regexp(RegexpBin) -> Regexp = binary_to_list(RegexpBin), - case regexp:parse(Regexp) of + case re:compile(Regexp) of {ok, _} -> ok; {error, Reason} -> throw({error, {invalid_regexp, Regexp, Reason}}) end. -- cgit v1.2.1