dounuogong0358 2013-04-04 19:22
浏览 62
已采纳

在哪里可以找到多种语言的正则表达式的单元测试?

I'm building a regex helper at http://www.debuggex.com. The amount of detail I want to show requires me to write my own parser and matcher.

To make sure my parser and matcher work correctly, I've written my own unit tests for the Javascript flavor of regexes, but these only cover edge cases I know about. I would like to use a standard test suite, and was recently pointed to http://hg.ecmascript.org/tests/test262/summary, which I will be using.

My question is, where can I find such test suites for other regex flavors? I'd like to support other flavors in the future. I have not been able to find anything by googling ("test" pollutes the results with regex testers). I am looking for test suites for the languages python, php, perl, java, ruby, and .net.

  • 写回答

3条回答 默认 最新

  • dqdfpmmi022763 2013-04-04 23:30
    关注

    Most of those languages are open source. Any decent project should have their test cases in said repo, otherwise I would be pretty concerned.

    • Python's regex tests
    • PHP's regex tests
    • Perl's regex tests looks really extensive
    • Open JDK's unit tests (an open source flavour of Java)
    • Ruby's regex tests
    • Mono's regex tests (open source version of .NET)
    • RE2's tests (C++ regex engine developed at Google)
    • C test suite (developed by AT&T Research)
    • PCRE regex tests (Perl Compatible Regular Expressions C library)
    • JavaScript regex tests (Ecma Technical Committee 39 compatability suite)

    I also found an extensive chart on this page which might be of some help to you.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!
  • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?