3 ms·
My 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
by pepijndevos 10y ago
My 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.