小编lht*_*lht的帖子

使用Erlang re模块的多行正则表达式

无法让Erlang重新为多线工作,请帮忙!

> re:run("hello,\nworld", "o,.*w", [multiline]).
nomatch
> re:run("hello,\nworld", "o,.*w", [multiline, {newline, lf}]).
nomatch

> {ok, MP} = re:compile("o,.*w", [multiline]).
{ok,{re_pattern,0,0,
                <<69,82,67,80,55,0,0,0,2,0,0,0,7,0,0,0,0,0,0,0,111,0,
                  119,...>>}}
> re:run("hello,\nworld", MP).
nomatch

> re:run("hello,\nworld", ",\nw").
{match,[{5,3}]}
Run Code Online (Sandbox Code Playgroud)

regex erlang

2
推荐指数
1
解决办法
1254
查看次数

标签 统计

erlang ×1

regex ×1