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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

A GPT 3.5 powered tool for generating regex

38 点作者 DefineOutside大约 2 年前

11 条评论

gregmac大约 2 年前
Pretty neat, and it definitely can generate some complex regex.. But I have to say I don&#x27;t trust it!<p>When I add a regex to something, I pretty much always also add a bunch of unit test cases for it, and I request the same if I see one in a PR. It&#x27;s much easier to just see a bunch of test cases that help validate than it, and frankly, half the time when I write my own cases I think of situations that could be better handled.<p>Human- or GPT-generated doesn&#x27;t really matter IMHO; it still needs tests.<p>Interestingly, chatGPT is pretty good at generating test cases for regex. It would be really cool to see that functionality integrated to this tool.
评论 #35380282 未加载
BMc2020大约 2 年前
<i>Rate limit reached for default-gpt-3.5-turbo in organization org-cy3MEIpOsyQxMokN4SQON5gb on requests per min. Limit: 20 &#x2F; min. Please try again in 3s. Contact support@openai.com if you continue to have issues. Please add a payment method to your account to increase your rate limit. Visit <a href="https:&#x2F;&#x2F;platform.openai.com&#x2F;account&#x2F;billing" rel="nofollow">https:&#x2F;&#x2F;platform.openai.com&#x2F;account&#x2F;billing</a> to add a payment method.</i><p>Ironically, it showed us the real future of AI
评论 #35386389 未加载
williamstein大约 2 年前
ChatGPT is also very useful for just explaining what a regexp you already have actually does.
评论 #35380299 未加载
thomasahle大约 2 年前
This is what is gives to select names: &#x2F;^[A-Z][a-z]+(?: [A-Z][a-z]+)*$&#x2F;<p>I&#x27;m pretty sure quite a lot of people&#x27;s names wouldn&#x27;t be accepted by that. It helps if you add &quot;even weird and foreign names&quot;, but who knows if that&#x27;s actually enough to capture everything.
评论 #35380548 未加载
评论 #35384118 未加载
评论 #35380527 未加载
totoglazer大约 2 年前
Have you tried GPT-4? I suspect it would do better for these types of characters.
themineraria大约 2 年前
I think I broke it pretty badly asking for &quot;A ll(1) grammar validator&quot; as it answered `^(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:[A-Z]|[a-z])(?:[A-Z]|[a-z]|[0-9])<i>):(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:[A-Z]|[a-z])(?:[A-Z]|[a-z]|[0-9])</i>):)+(?:(?:(?<p>lol<p>id: chatcmpl-6zxdwNH3hW7DuZqnCkx4Ukx9rXiuA token usage: 367 date: 1680225296
mike_hock大约 2 年前
&gt; &#x2F;^(?:\&#x2F;(?:\\\&#x2F;|[^\&#x2F;\n])+\&#x2F;[gimuy]{0,5}|\\[^\n]|[^\n\\\&#x2F;])+$&#x2F;<p>What would you say was the query for this?
评论 #35380590 未加载
TradingPlaces大约 2 年前
Finally, something useful to me. If it worked. My experience was spotty in that regard.
sw1sh大约 2 年前
Is it time to revive HTML regex meme yet?
sv123大约 2 年前
I once had a problem I solved with regex, now I have two problems.
Shindi大约 2 年前
If you&#x27;re using a regex it&#x27;s a smell that there is a better tool for what you need to do. A ton of if statements is a much more readable way of writing code than regex.
评论 #35380532 未加载
评论 #35380365 未加载