Re:Show HN: RegEx Face Off – Beat your friends with regular ...
by ygra on Saturday December 31, 2016 @10:32AM
(#13291413)
> 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.
Re:Show HN: RegEx Face Off – Beat your friends with regular ...
by impostervt on Saturday December 31, 2016 @09:37AM
(#13291182)
I think you just beat me at my own game.
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.