The Go Programming Language
http://golang.org/
Go Playground
Go Projects
Revel Web Framework
kinboy

golang 编译正则表达式报错

  •  
  •   kinboy · Oct 21, 2022 · 1573 views
    This topic created in 1329 days ago, the information mentioned may be changed or developed.

    regex101.com 写了一段正则表达式,并用 Code Generator 生成了 golang 的代码,结果编译时 panic 异常了,错误对战信息中无法定位具体是什么原因导致的异常,请大佬帮忙看看

    (?m)这是一段定位文字([\n\t\s]*\W+){5}[\n\t\s]*1[\n\t\s]*(?P<zhongbiao>\W+)(?=\n)

    Supplement 1  ·  Oct 21, 2022
    已经破案了,golang 标准库中的 regexp 包的实现为了保证执行效率没对前瞻后顾这些特性做支持,可以用其他支持该特性的轮子
    lysS
        1
    lysS  
       Oct 23, 2022
    go 的正则不是标准的吗?
    kinboy
        2
    kinboy  
    OP
       Oct 24, 2022 via Android
    @lysS 只是内置的标准库没有实现全部的 API ,有第三方库实现了前瞻后顾的
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   928 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 21:57 · PVG 05:57 · LAX 14:57 · JFK 17:57
    ♥ Do have faith in what you're doing.