ets:match/1
根据匹配模式匹配表里的对象数据
用法:
1 | match( Continuation ) -> {[ Match ], Continuation } | `$end_of_table` |
继续从 ets:match/3 方法开始匹配数据,调用 ets:match/3 方法跟匹配数据一起返回的变量 Continuation 可用在下一次调用这个函数来获取下一批的匹配数据。
如果没有更多的对象数据在表里,那么则返回 '$end_of_table'。
1 2 3 4 5 | Tab = ets:new (ets_tab, [named_table, bag]), ets:insert ( Tab , [{apple, 1}, {pear, 2}, {orange, 3}, {grape, 4}, {watermelon, 5}]), {_ Match , Continuation } = ets:match (ets_tab, '_' , 2), { Match , _ Continuation } = ets:match ( Continuation ), Match . |