# regex golf

Published articles for regex golf.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## The Many Faces of Set Cover

DevFeed: [The Many Faces of Set Cover](<https://devfeed.tech/articles/the-many-faces-of-set-cover-40382.md>)

Original publisher: [Read original article](<https://www.jeremykun.com/2015/05/04/the-many-faces-of-set-cover/>)

Published: 2015-05-04T09:00:00Z

Content type: tutorial

Language: en

Sources: [Jeremy Kun](<https://devfeed.tech/sources/jeremy-kun.md>)

Topics: [Algorithms, Complexity](<https://devfeed.tech/topics/algorithms-complexity.md>), [Regular expression](<https://devfeed.tech/topics/regular-expression.md>), [Databases](<https://devfeed.tech/topics/databases.md>)

Tags: [algorithm](<https://devfeed.tech/tags/algorithm.md>), [approximation-algorithms](<https://devfeed.tech/tags/approximation-algorithms.md>), [expression](<https://devfeed.tech/tags/expression.md>), [mathematics](<https://devfeed.tech/tags/mathematics.md>), [np](<https://devfeed.tech/tags/np.md>), [np-hard](<https://devfeed.tech/tags/np-hard.md>), [programming](<https://devfeed.tech/tags/programming.md>), [regex](<https://devfeed.tech/tags/regex.md>), [regex-golf](<https://devfeed.tech/tags/regex-golf.md>), [regular-expressions](<https://devfeed.tech/tags/regular-expressions.md>), [set-cover](<https://devfeed.tech/tags/set-cover.md>)

### AI overview

This tutorial explains the set cover problem and connects it to regex golf. It shows how selected regular expressions can be combined to cover desired strings while avoiding unwanted matches, and notes that set cover is NP-hard, motivating approximation algorithms.

### Source excerpt

A while back Peter Norvig posted a wonderful pair of articles about regex golf. The idea behind regex golf is to come up with the shortest possible regular expression that matches one given list of strings, but not the other. "Regex Golf," by Randall Munroe. In the first article, Norvig runs a basic algorithm to recreate and improve the results from the comic, and in the second he beefs it up with some improved search heuristics.