6 ms·
My strategy of "capture the last two characters of each input in the accept group followed by $" hasn't failed yet, and is quick to input and requires no though
by wwwigham 10y ago
My strategy of "capture the last two characters of each input in the accept group followed by $" hasn't failed yet, and is quick to input and requires no thought. Though I wouldn't say I'm practicing any practical RegEx skills doing so. :P
- impostervt 10y agoThere are a few questions that this strategy won't work on already. Guess I'll have to think up some more.
- pepijndevos 10y agoMy strategy was ^[].*[^]$ where you first fill in all the first letters of the match words and then all the last characters of the skip group. Works fairly well. I'm not sure if there is a length limit, but I'm fairly sure I could come up with a vim macro/regex that would allow me to copy the match words and make a (list|like|so) within 45 seconds. Give the time limit, it would be more fun to automatically let your strategy compete. (maybe with a weight of length vs correctness) Write a function that, given two arrays of words, return the best regex.
- impostervt 10y agoI think you just beat me at my own game.
- ygra 10y ago> Write a function that, given two arrays of words, return the best regex. I've actually done that with code-golf in the past. I needed a regex shorter than n that would match what I wanted it to match, so I generated valid regexes up to n length and tested them. A bit brute-force, but eventually saved me one character in the program.