diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_access_control.erl | 10 | ||||
| -rw-r--r-- | src/rabbit_dialyzer.erl | 4 | ||||
| -rw-r--r-- | src/rabbit_exchange.erl | 1 | ||||
| -rw-r--r-- | src/rabbit_exchange_type_topic.erl | 3 | ||||
| -rw-r--r-- | src/rabbit_misc.erl | 2 | ||||
| -rw-r--r-- | src/rabbit_multi.erl | 6 |
6 files changed, 11 insertions, 15 deletions
diff --git a/src/rabbit_access_control.erl b/src/rabbit_access_control.erl index 30bae25e5a..3aaf59281e 100644 --- a/src/rabbit_access_control.erl +++ b/src/rabbit_access_control.erl @@ -177,11 +177,9 @@ check_resource_access(Username, <<"">> -> <<$^, $$>>; RE -> RE end, - case regexp:match( - binary_to_list(Name), - binary_to_list(PermRegexp)) of - {match, _, _} -> true; - nomatch -> false + case re:run(Name, PermRegexp, [{capture, none}]) of + match -> true; + nomatch -> false end end, if Res -> ok; @@ -306,7 +304,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. diff --git a/src/rabbit_dialyzer.erl b/src/rabbit_dialyzer.erl index 0ec6beb676..51bd6b1f93 100644 --- a/src/rabbit_dialyzer.erl +++ b/src/rabbit_dialyzer.erl @@ -56,7 +56,7 @@ create_basic_plt(BasicPltPath) -> ok. add_to_plt(PltPath, FilesString) -> - {ok, Files} = regexp:split(FilesString, " "), + Files = string:tokens(FilesString, " "), DialyzerWarnings = dialyzer:run([{analysis_type, plt_add}, {init_plt, PltPath}, {output_plt, PltPath}, @@ -65,7 +65,7 @@ add_to_plt(PltPath, FilesString) -> ok. dialyze_files(PltPath, ModifiedFiles) -> - {ok, Files} = regexp:split(ModifiedFiles, " "), + Files = string:tokens(ModifiedFiles, " "), DialyzerWarnings = dialyzer:run([{init_plt, PltPath}, {files, Files}]), case DialyzerWarnings of diff --git a/src/rabbit_exchange.erl b/src/rabbit_exchange.erl index 9316934782..ce1229b5d4 100644 --- a/src/rabbit_exchange.erl +++ b/src/rabbit_exchange.erl @@ -49,7 +49,6 @@ -import(mnesia). -import(sets). -import(lists). --import(regexp). %%---------------------------------------------------------------------------- diff --git a/src/rabbit_exchange_type_topic.erl b/src/rabbit_exchange_type_topic.erl index a374cfee7f..89b2441e38 100644 --- a/src/rabbit_exchange_type_topic.erl +++ b/src/rabbit_exchange_type_topic.erl @@ -67,8 +67,7 @@ publish(#exchange{name = Name}, Delivery = Delivery). split_topic_key(Key) -> - {ok, KeySplit} = regexp:split(binary_to_list(Key), "\\."), - KeySplit. + re:split(Key, "\\.", [{return, list}]). topic_matches(PatternKey, RoutingKey) -> P = split_topic_key(PatternKey), diff --git a/src/rabbit_misc.erl b/src/rabbit_misc.erl index a211df378d..a7a3a7562c 100644 --- a/src/rabbit_misc.erl +++ b/src/rabbit_misc.erl @@ -613,7 +613,7 @@ string_to_pid(Str) -> binary_to_term(<<131,103,NodeEnc/binary,Id:32,Ser:32,0:8>>); nomatch -> throw(Err) - end. + end. version_compare(A, B, lte) -> case version_compare(A, B) of diff --git a/src/rabbit_multi.erl b/src/rabbit_multi.erl index 5db1d77a32..3facef17f7 100644 --- a/src/rabbit_multi.erl +++ b/src/rabbit_multi.erl @@ -309,9 +309,9 @@ is_dead(Pid) -> {win32, fun () -> Res = os:cmd("tasklist /nh /fi \"pid eq " ++ PidS ++ "\""), - case regexp:first_match(Res, "erl.exe") of - {match, _, _} -> false; - _ -> true + case re:run(Res, "erl\\.exe", [{capture, none}]) of + match -> false; + _ -> true end end}]). |
