【发布时间】:2021-09-24 15:31:27
【问题描述】:
我正在学习如何在 Erlang 中使用正则表达式获取字符串。 请向我解释为什么当我对值是从 0 到 255 的序列的元素列表执行正则表达式时,大于 127 的值会落入结果列表中?
Expected = true,
ValidCharacterList = lists:seq(0, 255),
RegularExpression = "[[:ascii:]]",
{ok, MP} = re:compile(RegularExpression),
{match, _} = re:run(ValidCharacterList, MP),
Result = true,
?assertEqual(Expected, Result).
结果是该序列的所有元素(从 0 到 255)。
【问题讨论】: