TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: Python library for regex with “extent-of-match”

2 点作者 georgeam将近 3 年前
From CS Theory, all regular expressions can be converted to deterministic finite automata. I would like a python library that tells me the precise point at which a string &quot;loses hope&quot; of matching a regular expression. Eg.<p>Given a regular expression like aba*<p>And a string like abbab<p>I want an output that says the match failed at an index of 2.<p>meaning that the first ab match (or more technically, are the prefix of a match), but the remaining bab &quot;kill&quot; the possibility of a match.<p>Anyone know of a python library that does this?

暂无评论

暂无评论