TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

AutoRegex

247 pointsby fbuilesvalmost 3 years ago

36 comments

Cyberdogalmost 3 years ago
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 未加载
colordropsalmost 3 years ago
I don&#x27;t trust regular expressions that <i>I</i> wrote, let alone some doped up parameter sniffing AI.
评论 #32032899 未加载
评论 #32033936 未加载
评论 #32036802 未加载
评论 #32034742 未加载
unsignedintalmost 3 years ago
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 未加载
gd3kralmost 3 years ago
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 未加载
polskibusalmost 3 years ago
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 未加载
wruzaalmost 3 years ago
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_peachalmost 3 years ago
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 未加载
gnulinuxalmost 3 years ago
<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 未加载
memorablealmost 3 years ago
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 未加载
kseistrupalmost 3 years ago
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 未加载
layer8almost 3 years ago
&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.
PenguinRevolveralmost 3 years ago
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.
anyfactoralmost 3 years ago
As a web scraper, thank god for .*? or to be exact [\s\S]*?<p>Does 90% of what I need.
rcshubhadeepalmost 3 years ago
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!
ramigbalmost 3 years ago
Why do I have to sign up?
spaniard89277almost 3 years ago
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.
mouzogualmost 3 years ago
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.
sourabhvalmost 3 years ago
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.
tragomaskhalosalmost 3 years ago
&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_lavialmost 3 years ago
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!
amrrsalmost 3 years ago
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>
MiddleMan5almost 3 years ago
I always imagined having a tool like this! Really psyched to have something to play with!
评论 #32032793 未加载
napieralmost 3 years ago
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.
texaslonghorn5almost 3 years ago
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 未加载
emilfihlmanalmost 3 years ago
&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
skyfalldevalmost 3 years ago
You also can use this for general GPT-3 queries, which is quite cool!
评论 #32035959 未加载
irony123almost 3 years ago
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.
revskillalmost 3 years ago
Hmmm, it might works, but need a unit test to verify.
Terry_Rollalmost 3 years ago
Different programming languages use different forms of RegEx, it doesnt suggest it caters for this difference.
ricardobayesalmost 3 years ago
If we only could get safari to support lookbehind regex that would be nice.
ggurfacealmost 3 years ago
Doesn&#x27;t work for me.<p>&gt; any word that has a penultimate character of a &gt; .*[a-z]n$
mutantalmost 3 years ago
Just... Learn regex. Jeez.
vladdosteralmost 3 years ago
Needs a way to delete your account
评论 #32032953 未加载
SMAAARTalmost 3 years ago
My prayers have been answered.
bruhhhalmost 3 years ago
the font is so tiny on the website preview I cant read anything
ViraCzalmost 3 years ago
damn this was good