In contrast, Perl, PCRE, Python, Ruby, Java, and many other languages have regular expression implementations based on recursive backtracking that are simple but can be excruciatingly slow.
当然,每种语言都会以不同的方式实现regex,尽管时间复杂性应该是相似的。如果您想调查它是如何完成的,您可以简单地read the algorithms。在
(我想评论,但我现在不能评论)
如果你仔细阅读了你链接的文章,它说Python使用了回溯算法。在
当然,每种语言都会以不同的方式实现regex,尽管时间复杂性应该是相似的。如果您想调查它是如何完成的,您可以简单地read the algorithms。在
相关问题 更多 >
编程相关推荐