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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

AutoRegex

247 点作者 fbuilesv将近 3 年前

36 条评论

Cyberdog将近 3 年前
Haven&#x27;t tried it since I&#x27;d rather not sign up for an account. But regarding this example:<p><pre><code> Minimum eight characters, at least one letter, one number and one special character &gt;&gt; ^(?=.*[A-Za-z])(?=.*d)(?=.*[@$!%*#?&amp;])[A-Za-zd@$!%*#?&amp;]{8,}$ </code></pre> I assume the &quot;d&quot; characters here are supposed to be &quot;\d&quot; but the backslashes wandered off somewhere. Not sure if that&#x27;s just in the example or the actual output from the AI. Some of those special characters like &quot;*&quot; and &quot;$&quot; need a backslash too.<p>Also, this pattern will not allow any character which is <i>not</i> a letter, number, or in that very finite list of special characters - so no spaces, no carets, no quote marks or apostrophes, etc. Not allowing certain printable characters in a password is a bad practice (I won&#x27;t complain too much if you forbid the non-printable ones).
评论 #32032436 未加载
评论 #32033547 未加载
colordrops将近 3 年前
I don&#x27;t trust regular expressions that <i>I</i> wrote, let alone some doped up parameter sniffing AI.
评论 #32032899 未加载
评论 #32033936 未加载
评论 #32036802 未加载
评论 #32034742 未加载
unsignedint将近 3 年前
Not an apple to apple comparison, but if you are trying to regex with help of software, my daily driver of building regex is RegexBuddy [1]. Not only makes building and testing regular expressions easy, but this pretty much covers all the Regex variants in the wild. (And comes with an excellent help file.)<p>The same author also make variant called RegexMagic [2] which probably would have closer premise with AutoRegex (less NN part, perhaps) as it is designed to make Regex without too much knowledge of regex, but I don&#x27;t know how well it works as I haven&#x27;t used it much...<p>[1]: <a href="https:&#x2F;&#x2F;www.regexbuddy.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.regexbuddy.com&#x2F;</a><p>[2]: <a href="https:&#x2F;&#x2F;www.regexmagic.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.regexmagic.com&#x2F;</a>
评论 #32035468 未加载
gd3kr将近 3 年前
Hey! I’m the creator of www.autoregex.xyz (@gd3kr on twitter) I originally built it as a small side project in a couple days, I was absolutely not expecting a response this massive. I realise concerns about email and password sign up, and I built it in an hour-ish with firebase auth as a temporary solution to capping the sudden surge in GPT3 requests to the server after the twitter post gained traction. Im working on a better approach to that involving not having to create an account. Otherwise, all suggestions are absolutely welcome. Please tell me how I can make this a better experience for everyone.
评论 #32033591 未加载
评论 #32034089 未加载
评论 #32038045 未加载
评论 #32033661 未加载
评论 #32058091 未加载
polskibus将近 3 年前
I’d bet users would’ve preferred to provide examples of input and output to get the regexp they want , instead of designing it in plain English.
评论 #32032552 未加载
评论 #32032599 未加载
评论 #32033541 未加载
wruza将近 3 年前
Btw, does anyone know a library&#x2F;program which can reverse engineer a regex from multiple source strings? E.g.<p><pre><code> 14:51 [info] 51 some message … more of 51 lines … 15:22 [error] 24 error! … more of 24 lines … ^(\d\d:\d\d) \[(info|error)\] (\d+) (.+)$ </code></pre> Or maybe not a regex, but a structured pattern.
评论 #32034816 未加载
评论 #32034434 未加载
评论 #32037544 未加载
评论 #32040546 未加载
评论 #32034261 未加载
评论 #32033812 未加载
评论 #32034875 未加载
评论 #32033939 未加载
georgia_peach将近 3 年前
It is surprising &#x2F; not surprising to see the lengths people go to not learn regex. There&#x27;s not much to it. If you&#x27;re just starting out, find a good reference, and memorize it. Mastery is another thing entirely, but it always is.<p>In *nix land, a decent reference is built-in: `man awk` and jump to the &quot;Regular Expressions&quot; section.
评论 #32035541 未加载
gnulinux将近 3 年前
<p><pre><code> All words starting with the letter &quot;n&quot; and ending with &quot;g&quot;, case insensitive &gt;&gt; &#x2F;^nw*g$&#x2F;i </code></pre> This is not right. That should be a &quot;\w&quot; instead of &quot;w&quot;.
评论 #32032725 未加载
评论 #32035703 未加载
memorable将近 3 年前
I have played with this for a while, and here are some prompts that might be interesting.<p>Prompt: &quot;URL regex&quot;<p><pre><code> ^(https?:\&#x2F;\&#x2F;)?([\da-z\.-]+)\.([a-z\.]{2,6})([\&#x2F;\w \.-]*)*\&#x2F;?$ </code></pre> Prompt: &quot;Email regex&quot;<p><pre><code> &#x2F;^(([^&lt;&gt;()\[\]\\.,;:\s@&quot;]+(\.[^&lt;&gt;()\[\]\\.,;:\s@&quot;]+)*)|(&quot;.+&quot;))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,})) </code></pre> This one&#x27;s weirdly sophisticated for some reason.<p>Prompt: &quot;An HTML tag with a close tag and attributes&quot;<p><pre><code> &lt;([a-zA-Z]+)[^&gt;]*?(?&lt;!\&#x2F;)&gt;.*?&lt;\&#x2F;\1&gt;</code></pre>
评论 #32032926 未加载
评论 #32037805 未加载
kseistrup将近 3 年前
Also regex-related: Pomsky: <a href="https:&#x2F;&#x2F;pomsky-lang.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;pomsky-lang.org&#x2F;</a> (formerly Rulex)
评论 #32034897 未加载
layer8将近 3 年前
&gt; difficult to […] comprehend<p>You’ll still have to fully comprehend the auto-generated regex to make sure that it really does what you want. So the tool may help with coming up with a suitable regex, but doesn’t remove the need for comprehension.
PenguinRevolver将近 3 年前
Tried RegEx → English:<p><pre><code> \&quot;object\&quot;: \[(.*?)\] ---- The regular expression matches a string that contains &quot;object&quot;: followed by a space and an open bracket, then any characters, then a close bracket. The characters between the open and close bracket are captured in a group. </code></pre> Pretty cool.
anyfactor将近 3 年前
As a web scraper, thank god for .*? or to be exact [\s\S]*?<p>Does 90% of what I need.
rcshubhadeep将近 3 年前
Did a hobby project a while ago, just the reverse. Wrote a blog post - <a href="https:&#x2F;&#x2F;medium.com&#x2F;codist-ai&#x2F;generating-natural-language-description-of-regex-using-deep-learning-679248a95dab" rel="nofollow">https:&#x2F;&#x2F;medium.com&#x2F;codist-ai&#x2F;generating-natural-language-des...</a> (colab - <a href="https:&#x2F;&#x2F;colab.research.google.com&#x2F;drive&#x2F;1QibOifIJQB2tfLyy_mmw8N9LpchDWnIz" rel="nofollow">https:&#x2F;&#x2F;colab.research.google.com&#x2F;drive&#x2F;1QibOifIJQB2tfLyy_mm...</a>)<p>Also gave a pycon talk - <a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=Zugbqg9HFHQ" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=Zugbqg9HFHQ</a><p>It was fun, achieved good result but did not need a monster like GPT3!
ramigb将近 3 年前
Why do I have to sign up?
spaniard89277将近 3 年前
Mmm, it produces an expression matching the input? You should put some examples. I&#x27;m a noob but AFAIK there are different regex engines out there, which one is this output? I remember trying other regex generators in knime and not working.
mouzogu将近 3 年前
I definitely need something like this. My brain seems to insta-delete all Regex knowledge after 1 week.<p>However, why do I need to sign up to test it. I&#x27;m guessing there is some paywall after. This feels like that github co-pilot rugpull.
sourabhv将近 3 年前
Switch from &quot;regex to english&quot; and write &quot;email&quot;.<p>Instead of saying it will match the string &quot;email&quot;, it says the opposite, english -&gt; regex conversion<p>&gt; regex = &#x2F;\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\Z&#x2F;i<p>&gt; This regular expression is used to match an email address. It starts by matching any character that is not a space or the &quot;@&quot; symbol, followed by the &quot;@&quot; symbol, then any characters that are not a space or the &quot;.&quot; symbol, followed by a &quot;.&quot; character, and finally any characters that are not a space.
tragomaskhalos将近 3 年前
&quot;Something I can use to grep the word list on my Mac to cheat at Worldle. My remaining letters are ...., my green letters thus far are .... and my yellows are ...&quot;
yoav_lavi将近 3 年前
I created Melody (<a href="https:&#x2F;&#x2F;github.com&#x2F;yoav-lavi&#x2F;melody" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;yoav-lavi&#x2F;melody</a>) for the same reasons you&#x27;ve mentioned in the website. I knew AI would try to replace me one day, but I didn&#x27;t think it&#x27;d be so soon.<p>Kidding of course, looks really cool!
amrrs将近 3 年前
Here&#x27;s how you can do it without GPT-3 (using BLOOM an opensource alternative) <a href="https:&#x2F;&#x2F;twitter.com&#x2F;1littlecoder&#x2F;status&#x2F;1545818058153140224" rel="nofollow">https:&#x2F;&#x2F;twitter.com&#x2F;1littlecoder&#x2F;status&#x2F;1545818058153140224</a>
MiddleMan5将近 3 年前
I always imagined having a tool like this! Really psyched to have something to play with!
评论 #32032793 未加载
napier将近 3 年前
This is the kind of use case I’d like to see more of! Less of the p-zombie copywriting neoplagiarism services with pot-luck output, more GPT-as-backend functional apps as productivity multipliers, if that makes sense.
texaslonghorn5将近 3 年前
I typed in<p>&gt; Email<p>&gt; English → RegEx<p>&gt; 95<p>&gt; GO<p>&gt; \w+@\w+\.\w+<p>That&#x27;s an <i>interesting</i> email regex.
评论 #32032710 未加载
评论 #32033624 未加载
emilfihlman将近 3 年前
&gt;All words starting with the letter &quot;n&quot; and ending with &quot;g&quot;, case insensitive &gt;&gt; &#x2F;^nw*g$&#x2F;i<p>The example regex is completely wrong, it should be &#x2F;n[a-z]*g&#x2F;ig
skyfalldev将近 3 年前
You also can use this for general GPT-3 queries, which is quite cool!
评论 #32035959 未加载
irony123将近 3 年前
Excellent. Worked for me. The output can modified but this provide a great start. I do regex so seldom I can&#x27;t remember notation for lookahead for example which this provides.
revskill将近 3 年前
Hmmm, it might works, but need a unit test to verify.
Terry_Roll将近 3 年前
Different programming languages use different forms of RegEx, it doesnt suggest it caters for this difference.
ricardobayes将近 3 年前
If we only could get safari to support lookbehind regex that would be nice.
ggurface将近 3 年前
Doesn&#x27;t work for me.<p>&gt; any word that has a penultimate character of a &gt; .*[a-z]n$
mutant将近 3 年前
Just... Learn regex. Jeez.
vladdoster将近 3 年前
Needs a way to delete your account
评论 #32032953 未加载
SMAAART将近 3 年前
My prayers have been answered.
bruhhh将近 3 年前
the font is so tiny on the website preview I cant read anything
ViraCz将近 3 年前
damn this was good