Erlang 正则表达式与重新加载问题
这可能是非常基本的事情,但是我的 Erlang 安装顽固地拒绝我对 重新
模块与error:undef
s。但是,它接受 regexp
包,因此我认为这是版本问题。
我正在运行 v. 5.6.2,文件顶部有 -import(re, [...]).
,是否还有其他我可能遗漏的问题?我搜索了相当多的时间,但找不到描述所需最低版本的页面。
与此相关的是,由于我对 Erlang 及其工具/社区/开发环境还很陌生,如果您对经常访问的网站有任何建议,或者改变您的开发周期的工具,请告诉我。
谢谢!
编辑:如果您想查看一些代码:
Erlang (BEAM) emulator version 5.6.2 [source] [smp:2] [async-threads:0] [kernel-poll:false]
Eshell V5.6.2 (abort with ^G)
1> re:compile("paul").
** exception error: undefined function re:compile/1
2> regexp:match("paul","au").
{match,2,2}
在我的 Eunit 测试中:
::error:undef
in function re:compile/1
called as compile("\\s+")
This is probably something very basic, but my Erlang installation is doggedly rejecting my calls to the re
module with error:undef
s. It accepts the regexp
package, however, so I'm thinking its a version issue.
I'm running v. 5.6.2, and -import(re, [...]).
at the top of my file, are there any other gotchas I may be missing? I searched for a fair bit of time, but couldn't find a page describing the minimum version needed.
On a related note, since I'm still pretty fresh to Erlang and its tools/community/dev environments, if you have any suggestions for sites to visit frequently, or tools that changed your dev cycle, please let me know.
Thanks!
EDIT: If you want to see some code:
Erlang (BEAM) emulator version 5.6.2 [source] [smp:2] [async-threads:0] [kernel-poll:false]
Eshell V5.6.2 (abort with ^G)
1> re:compile("paul").
** exception error: undefined function re:compile/1
2> regexp:match("paul","au").
{match,2,2}
And in my Eunit test:
::error:undef
in function re:compile/1
called as compile("\\s+")
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你的 Erlang 安装非常旧。它可能是 R12B 之前的版本之一。目前最新的稳定版本是R13B04,R14目前处于测试阶段。
Your Erlang installation is very old. It is probably one of pre-R12B releases. The most current stable version is R13B04, and R14 is in beta stage now.
首先尝试在 Erlang shell 中运行正则表达式代码,看看是否出现相同的错误。
也许发布实际代码会有所帮助。
Try first running your regex code in the Erlang shell and see if you get the same error.
Maybe posting the actual code would help.