-module(wikipedia).
-export([main/0]).
-define(Url, "http://en.wikipedia.org/w/api.php?format=xml&action=parse&prop=sections&page=Chicago").
-define(Match, "^[A-Za-z]+[A-Za-z0-9]*$").
main() ->
inets:start(),
%% Start ssl application
ssl:start(),
{ok, {_Status, _Header, Body}} = httpc:request(?Url),
T = re:run(Body, ?Match, [{capture, all_but_first, binary}]),
io:format("~s~n",[T]).
我想使用正则表达式匹配将维基百科页面的内容存储在“T”中。然后我要去取标题。但是上面的代码说不匹配。我不知道如何使用 erlang 获取维基百科页面的标题。请帮忙。(我是erlang的新手)。[我想要类似的东西:https://stackoverflow.com/questions/13459598/how-to-get-titles-from-a-wikipedia-page]