diff options
author | Björn Gustavsson <[email protected]> | 2011-10-27 12:27:33 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2011-10-27 12:27:33 +0200 |
commit | a971c9568ccebed4e8d00abf52faa59a2bcc1c18 (patch) | |
tree | 1a39c38bce2e27954ea772e80224069b41e5bcd9 /lib/runtime_tools/src | |
parent | 86e4b23fb4a11f18834e6b1be76642fbd71b9cf7 (diff) | |
parent | 3e8720728abe875683ad54fa4d93ba83df609f57 (diff) | |
download | otp-a971c9568ccebed4e8d00abf52faa59a2bcc1c18.tar.gz otp-a971c9568ccebed4e8d00abf52faa59a2bcc1c18.tar.bz2 otp-a971c9568ccebed4e8d00abf52faa59a2bcc1c18.zip |
Merge branch 'bjorn/eliminate-regexp-usage'
* bjorn/eliminate-regexp-usage:
erl_tidy: Eliminate two references to 'regexp' in the documentation
erts/z_SUITE: Eliminate use of deprecated regexp module
erts/nt_SUITE: Eliminate use of deprecated regexp module
erl_html_tools: Eliminate mention of deprecated regexp module
erl_interface tests: Eliminate use of deprecated regexp module
tools test suite: Eliminate compilation warnings for the eed module
tools test suite: Eliminate use of deprecated regexp module
xmerl test suite: Eliminate use of deprecated regexp module
appmon: Eliminate use of deprecated regexp module
tv: Eliminate use of deprecated regexp module
gs: Eliminate use of deprecated regexp module
inviso: Eliminate use of deprecated regexp module
Diffstat (limited to 'lib/runtime_tools/src')
-rw-r--r-- | lib/runtime_tools/src/inviso_rt.erl | 4 | ||||
-rw-r--r-- | lib/runtime_tools/src/inviso_rt_lib.erl | 16 |
2 files changed, 10 insertions, 10 deletions
diff --git a/lib/runtime_tools/src/inviso_rt.erl b/lib/runtime_tools/src/inviso_rt.erl index ac7ac2a584..b162f5b045 100644 --- a/lib/runtime_tools/src/inviso_rt.erl +++ b/lib/runtime_tools/src/inviso_rt.erl @@ -2359,8 +2359,8 @@ list_wrapset(Prefix,Suffix) -> list_wrapset_2([File|Rest],RegExp) -> Length=length(File), - case regexp:first_match(File,RegExp) of - {match,1,Length} -> % This is a member of the set. + case re:run(File,RegExp) of + {match,[{0,Length}]} -> % This is a member of the set. [File|list_wrapset_2(Rest,RegExp)]; _ -> list_wrapset_2(Rest,RegExp) diff --git a/lib/runtime_tools/src/inviso_rt_lib.erl b/lib/runtime_tools/src/inviso_rt_lib.erl index 2c6964e53e..ee6a72ae0c 100644 --- a/lib/runtime_tools/src/inviso_rt_lib.erl +++ b/lib/runtime_tools/src/inviso_rt_lib.erl @@ -197,15 +197,15 @@ match_modules(RegExpDir,RegExpMod,Actions) -> handle_expand_regexp_2([{Mod,Path}|Rest],RegExpDir,RegExpMod,Result) -> ModStr=atom_to_list(Mod), ModLen=length(ModStr), - case regexp:first_match(ModStr,RegExpMod) of - {match,1,ModLen} -> % Ok, The regexp matches the module. + case re:run(ModStr,RegExpMod) of + {match,[{0,ModLen}]} -> % Ok, The regexp matches the module. if is_list(RegExpDir),is_atom(Path) -> % Preloaded or covercompiled... handle_expand_regexp_2(Rest,RegExpDir,RegExpMod,Result); is_list(RegExpDir),is_list(Path) -> % Dir reg-exp is used! PathOnly=filename:dirname(Path), % Must remove beam-file name. - case regexp:first_match(PathOnly,RegExpDir) of - {match,_,_} -> % Did find a match, that is enough! + case re:run(PathOnly,RegExpDir,[{capture,none}]) of + match -> % Did find a match, that is enough! handle_expand_regexp_2(Rest,RegExpDir,RegExpMod,[Mod|Result]); _ -> % Either error or nomatch. handle_expand_regexp_2(Rest,RegExpDir,RegExpMod,Result) @@ -233,8 +233,8 @@ handle_expand_regexp_3([Path|Rest],RegExpDir,RegExpMod,AllLoaded,Result) -> volumerelative -> % Only on Windows!? filename:absname(Path) end, - case regexp:first_match(AbsPath,RegExpDir) of - {match,_,_} -> % Ok, the directory is allowed. + case re:run(AbsPath,RegExpDir,[{capture,none}]) of + match -> % Ok, the directory is allowed. NewResult=handle_expand_regexp_3_1(Path,RegExpMod,AllLoaded,Result), handle_expand_regexp_3(Rest,RegExpDir,RegExpMod,AllLoaded,NewResult); _ -> % This directory does not qualify. @@ -262,8 +262,8 @@ handle_expand_regexp_3_2([File|Rest],RegExpMod,AllLoaded,Result) -> case {lists:keysearch(Mod,1,AllLoaded),lists:member(Mod,Result)} of {false,false} -> % This module is not tried before. ModLen=length(ModStr), - case regexp:first_match(ModStr,RegExpMod) of - {match,1,ModLen} -> % This module satisfies the regexp. + case re:run(ModStr,RegExpMod) of + {match,[{0,ModLen}]} -> % This module satisfies the regexp. handle_expand_regexp_3_2(Rest,RegExpMod,AllLoaded,[Mod|Result]); _ -> % Error or not perfect match. handle_expand_regexp_3_2(Rest,RegExpMod,AllLoaded,Result) |