2 ms·
> 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
by 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.