|
|
need regex to natural language and vice versa
"A little time, a little trouble, your better day"
Badfinger
|
|
|
|
|
This alleged AI-powered generator got me close to what I needed today: https://www.regexgo.com/[^]
And this site was a great help in troubleshooting and refining the AI's results: https://regex101.com/[^]
Bonus: I still don't understand RegEx.
There are no solutions, only trade-offs. - Thomas Sowell
A day can really slip by when you're deliberately avoiding what you're supposed to do. - Calvin (Bill Watterson, Calvin & Hobbes)
|
|
|
|
|
I used ChatGPT precisely for that and it returned a decent regex with an explanation.
I needed to word my question in a manner that was generic but the result was actually helpful.
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens
modified 14-Dec-23 1:50am.
|
|
|
|
|
cool. forgot chatgpt is hanging out there
"A little time, a little trouble, your better day"
Badfinger
|
|
|
|
|
I had exactly the dilemna you had - I was looking for a reverse regular expression parser i.e. create a regular expression from a desired result and an initial string and I thought I would give ChatGPT a go.
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens
|
|
|
|
|
It seems like it would be difficult to describe a non-trivial match in human language.
Though you might be able to feed a regex expression to ChatGPT and ask it what it matches - sort of the reverse of what you suggested.
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
A long time ago I wrote a tool.
The tool allowed you to multiply select portions of text and it would attempt to generate regexs that would only match the selected text
It didn't work very well, at least my implementation but I think the idea has merit.
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
honey the codewitch wrote: A long time ago I wrote a tool.
Not so long ago I wrote a tool ...
Now I'm unemployed
"A little song, a little dance, a little seltzer down your pants"
Chuckles the clown
|
|
|
|
|
That's why you keep your tool to yourself.
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
Not keeping your tool to yourself is one of the leading causes of dismissal, too.
"A little song, a little dance, a little seltzer down your pants"
Chuckles the clown
|
|
|
|
|
lordy...
"its a bad worker who blames their tools."
"there is no tool like an old tool."
"A little time, a little trouble, your better day"
Badfinger
modified 15-Dec-23 21:34pm.
|
|
|
|
|
They should be called irregular expressions.
|
|
|
|
|
Ron Anders wrote: They should be called irregular expressions.
Or ChineseExpressions, because I'll become more proficient in Chinese before RegEx!
As the aircraft designer said, "Simplicate and add lightness".
PartsBin an Electronics Part Organizer - Release Version 1.3.0 JaxCoder.com
Latest Article: SimpleWizardUpdate
|
|
|
|
|
Joking aside, more trivially I believe the term "regular" refers to the third level of Chomsky's hierarchy, which, precisely, is defined as Type3-Regular. DFA (Deterministic Finite Automaton) are FSA (Finite State Automaton).
|
|
|
|
|
Can confirm.
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
The following quote is the only good thing I've found in relation to RegEx...
Anonymous Dev said: Some people, when confronted with a problem, think "I know, I'll use a RegEx."
Now they have two problems.
|
|
|
|
|
RegExes are like any other tool/language. Great if you've learned how to use it, otherwise you're likely to get annoyed.
Many people here probably touch type, but the first time you used a keyboard you possibly thought "why can't they just put the letters in alphabetical order so they're easy to find?"
|
|
|
|
|
StarNamer@work wrote: "why can't they just put the letters in alphabetical order so they're easy to find?" A better question is "why are we so enslaved to tradition that we keep using a layout optimized for the Remington No 2 mechanical typewriter over 100 years ago?" And, please, don't get me started on the sexagesimal system used for time and degrees!
Mircea
|
|
|
|
|
Take my QWERTY keyboard away? Over my dead body!
Paul Sanders.
If I had more time, I would have written a shorter letter - Blaise Pascal.
Some of my best work is in the undo buffer.
|
|
|
|
|
Mircea Neacsu wrote: why are we so enslaved to tradition that we keep using a layout optimized for the Remington No 2 mechanical typewriter over 100 years ago
I believe because, despite claims (and faked data), no alternative has been shown to actually be better.
If I recall correct one of the magazines, either "Skeptical Inquirer" or "Skeptic" had at least one article in say the past 10 years that documented the history of that.
Possible that there might be some that are as good as, but then that by itself is no reason to switch.
|
|
|
|
|
I recall this too.
Qwerty I heard was in part laid out to slow typists down so the mechanical typewriter could keep up. I heard it from the Beagle Bros back in the 1980s so I don't know how true it is.
Either way, presumably eventually that wasn't an issue anymore.
And Devorak was a common alternative, or at least common as qwerty alternatives go.
It was touted as better, but despite the hype I remember reading that it didn't actually improve people's WPM.
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
honey the codewitch wrote: out to slow typists down so the mechanical typewriter could keep up
Not exactly. Rather the layout exists to allow typing to be faster.
QWERTY - Wikipedia[^]
"but rather to speed up typing. Indeed, there is evidence that, aside from the issue of jamming, placing often-used keys farther apart increases typing speed, because it encourages alternation between the hands."
honey the codewitch wrote: but despite the hype
I believe that was the one where the data was faked.
|
|
|
|
|
|
Too funny. Yeltsin was a good sport there.
Paul Sanders.
If I had more time, I would have written a shorter letter - Blaise Pascal.
Some of my best work is in the undo buffer.
|
|
|
|