Why doesnt work regex
问题 Code Example 14> case re:run("5162754", "/^\d+$/") of {match, _} -> ok end. ** exception error: no case clause matching nomatch 15> case re:run(<<"5162754">>, "/^\d+$/") of {match, _} -> ok end. ** exception error: no case clause matching nomatch Why doesn't it match? 回答1: Two things: The regular expression you pass to re:run shouldn't be surrounded by / . In other languages, you write a regexp inside / signs, but in Erlang, regexps are always written as strings, and thus no / signs are