From f94ff4fb58b9db3926ce0fea2c0fb4b18b1823ca Mon Sep 17 00:00:00 2001 From: Hans Bolinder Date: Wed, 3 Mar 2010 09:44:34 +0000 Subject: OTP-8472 tools: xref: re/regexp Xref has been updated to use the re module instead of the deprecated regexp module. --- lib/tools/src/xref_utils.erl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/tools/src/xref_utils.erl') diff --git a/lib/tools/src/xref_utils.erl b/lib/tools/src/xref_utils.erl index 680b7e8aac..0ef199cec7 100644 --- a/lib/tools/src/xref_utils.erl +++ b/lib/tools/src/xref_utils.erl @@ -640,22 +640,22 @@ neighbours([], G, Fun, VT, L, _V, Vs) -> neighbours(Vs, G, Fun, VT, L). match_list(L, RExpr) -> - {ok, Expr} = regexp:parse(RExpr), + {ok, Expr} = re:compile(RExpr), filter(fun(E) -> match(E, Expr) end, L). match_one(VarL, Con, Col) -> select_each(VarL, fun(E) -> Con =:= element(Col, E) end). match_many(VarL, RExpr, Col) -> - {ok, Expr} = regexp:parse(RExpr), + {ok, Expr} = re:compile(RExpr), select_each(VarL, fun(E) -> match(element(Col, E), Expr) end). match(I, Expr) when is_integer(I) -> S = integer_to_list(I), - {match, 1, length(S)} =:= regexp:first_match(S, Expr); + {match, [{0,length(S)}]} =:= re:run(S, Expr, [{capture, first}]); match(A, Expr) when is_atom(A) -> S = atom_to_list(A), - {match, 1, length(S)} =:= regexp:first_match(S, Expr). + {match, [{0,length(S)}]} =:= re:run(S, Expr, [{capture, first}]). select_each([{Mod,Funs} | L], Pred) -> case filter(Pred, Funs) of -- cgit v1.2.3