Code challenges that involve the use of regular expressions.

learn more… | top users | synonyms (1)

15
votes
4answers
3k views

Meta regex golf

In the spirit of this xkcd Write a program that plays regex golf with arbitrary pairs of lists. The program should at least attempt to make the regex short, a program that just outputs ...
14
votes
4answers
847 views

Match strings whose length is a fourth power

Within the scope of this question, let us consider only strings which consist of the character x repeated arbitrary number of times. For example: <empty> x xx xxxxxxxxxxxxxxxx (Well, ...
8
votes
2answers
492 views

Compile Regexes

In this task you have to write a program that reads a regular expression and generates another program that outputs whether an input string is accepted by that regular expression. The output must be a ...
53
votes
25answers
11k views

Shortest unmatchable regular expression

Your mission is to write the shortest valid regular expression that no string can match, empty string included. Submissions must have this form ("literal notation"): /pattern/optional-flags ...
4
votes
2answers
213 views

Regex for Finding Radioactive Elements

Find the shortest regex that matches all radioactive elements and nothing else in the Periodic Table of Elements. Radioactive Elements ...
3
votes
2answers
131 views

Reverse Regular expressions [closed]

The idea here is to write a little segment that will spit out regular expression patterns when given a string that matches them. As you might have guessed, this will be a popularity contest, and I'll ...
3
votes
2answers
259 views

Negative Regexp

Write the shortest function that takes one string, and returns a regular expression that matches anything EXCEPT the input string, in parenthesis. Escape necessary characters like Perl quotemeta. ...