Submit | All submissions | Best solutions | Back to list |

## REGEX024 - Euclid |

This is a regex golf problem. You have to write a regex that matches all lines from one list and none from the second one. Matching is implemented as Perl's m//, so it's not a precise match. E.g. to match "SPOJ" you don't need regex /^SPOJ$/ since it's enough to write /PO/ or /J/.

The regexes submitted should be compatible with Perl regular expressions (version 5.20.1).

Score is calculated as follows: it's equal to the length of your regex and for every line from the first list that's not matched by your regex X points are added to your score. Analogically, for every line from the second list that's matched by your regex X points are added to your score. The lower your score is, the better. X often equals 10 but it's different in some problems. Check below this problem's X value.

To quickly check the quality of your solution visit the original regex golf project.

Please don't look for solutions for this problem online or at least don't post them here if you didn't come up with them on your own.

## Match all of these...

- gcd(x, x) = x
- gcd(x, xxxxxxxxxxxxxxxx) = x
- gcd(xx, x) = x
- gcd(xxx, xxx) = xxx
- gcd(xxx, xxxxxxxxxxxx) = xxx
- gcd(xxxx, xxxxxxxxx) = x
- gcd(xxxx, xxxxxxxxxx) = xx
- gcd(xxxxx, xxxxxxx) = x
- gcd(xxxxxx, xxxx) = xx
- gcd(xxxxxx, xxxxx) = x
- gcd(xxxxxx, xxxxxx) = xxxxxx
- gcd(xxxxxx, xxxxxxxxx) = xxx
- gcd(xxxxxxx, xxxxxxx) = xxxxxxx
- gcd(xxxxxxx, xxxxxxxx) = x
- gcd(xxxxxxxx, xxxxxxxxxxxx) = xxxx
- gcd(xxxxxxxxxx, xxxx) = xx
- gcd(xxxxxxxxxx, xxxxx) = xxxxx
- gcd(xxxxxxxxxxxx, xxxxxx) = xxxxxx
- gcd(xxxxxxxxxxxxxxx, xxxxxxxxx) = xxx
- gcd(xxxxxxxxxxxxxxxxxx, xxxx) = xx

## And none of these...

- gcd(x, x) = xx
- gcd(x, xxxxx) = xxxxx
- gcd(xx, xxxxxx) = x
- gcd(xx, xxxxxxxxx) = xx
- gcd(xxx, xxxxxx) = xxxx
- gcd(xxx, xxxxxxxxxxxx) = xxxxxx
- gcd(xxxx, xxxxxxxx) = xx
- gcd(xxxxx, xxxxxxxxxxxxxx) = xxxx
- gcd(xxxxxx, xxxxxxxx) = xxx
- gcd(xxxxxx, xxxxxxxxx) = xxxxxx
- gcd(xxxxxx, xxxxxxxxxxxx) = xx
- gcd(xxxxxxx, xxxxxxx) = x
- gcd(xxxxxxxx, xxxxxxxxxx) = x
- gcd(xxxxxxxx, xxxxxxxxxxxx) = xx
- gcd(xxxxxxxxx, xxxxxxxxxxxx) = x
- gcd(xxxxxxxxxx, xxxxxxxxxx) = xxxxx
- gcd(xxxxxxxxxxxx, xxxxxxxxxx) = xxxxx
- gcd(xxxxxxxxxxxxxx, xxx) = xxx
- gcd(xxxxxxxxxxxxxxx, xxxxx) = x
- gcd(xxxxxxxxxxxxxxxx, xx) = xxxx

## X = 10

**The author of this problem is teukon.**

Added by: | Piotr Ką kol |

Date: | 2016-02-23 |

Time limit: | 1s |

Source limit: | 1000B |

Memory limit: | 1536MB |

Cluster: | Cube (Intel G860) |

Languages: | TEXT |

Resource: | http://regex.alf.nu |