Skip to main content

Questions tagged [pattern-matching]

For challenges about matching a particular pattern or patterns.

7 votes
7 answers
835 views

BBCode is a markup language commonly used in webforum software in the 2000s and 2010s. Your task is to write a program or function that translates BBCode to HTML according to the following spec. (...
robinpie's user avatar
  • 555
8 votes
6 answers
1k views

I was thinking when SQL can be less verbose than traditional programming languages and came up with this challenge. Input Natural number N Generating data We ...
Dr Y Wit's user avatar
  • 598
4 votes
2 answers
238 views

This is a sequel to Ragged list pattern matching. In this challenge, the wildcard may match a sequence of items of any length instead of just a single item. Given a pattern and a ragged list of ...
alephalpha's user avatar
12 votes
2 answers
747 views

This question is an extension of Who's that Polygon? to arbitrary numbers of sides. A fundamental polygon for a surface is an polygon with a prescribed pairing for all its \$2n\$ sides, each ...
Parcly Taxel's user avatar
  • 4,749
9 votes
5 answers
503 views

Introduction: Some times using a 24-hour clock are formatted in a nice pattern. For these patterns, we'll have four different categories: ...
Kevin Cruijssen's user avatar
4 votes
3 answers
1k views

So the golf question was like this: You are given a number T and then a total of T number of 17-character strings. For each of ...
chnmasta05's user avatar
15 votes
14 answers
1k views

Given a pattern and a ragged list of positive integers, your task is to decide whether the pattern matches the ragged list. The pattern is also represented by a ragged list. But in addition to ...
alephalpha's user avatar
10 votes
1 answer
424 views

Consider a NxN pixel grid with up to M objects drawn on it, either squares or diamonds: square    diamond The objects may overlap, so recognition is hard. The task is to give the minimal possible ...
Hans-Peter Stricker's user avatar
8 votes
1 answer
246 views

Caves and Cliffs edition Part 1, Very related You're given a piece of ASCII art representing a piece of land, like so: ...
emanresu A's user avatar
  • 46.8k
15 votes
4 answers
415 views

Given an ASCII-art shape made of the characters /\|_, your challenge is to return the number of sides it has. A side is a straight line of one of those, for example:...
emanresu A's user avatar
  • 46.8k
18 votes
9 answers
2k views

But Is It Art? is an esolang created by ais523, where one step is break the program into orthogonally connected "tiles": A BBBB A B B AA CC A CC Each ...
caird coinheringaahing's user avatar
9 votes
4 answers
561 views

This fastest-code challenge is based partly on this MSE question and exists to extend some OEIS sequences, and create others. If I extend or create sequences based on this challenge, I'll link to this ...
Peter Kagey's user avatar
  • 8,205
20 votes
8 answers
2k views

(This challenge is related to the challenge "Generate the Abacaba sequence.") Zimin words (also called "sesquipowers") are an important idea in the subject of "combinatorics ...
Peter Kagey's user avatar
  • 8,205
27 votes
9 answers
3k views

Given a matrix of size at least 3×3 formed by positive integers, determine if it contains at least one "U" pattern, defined as ...
Luis Mendo's user avatar
  • 107k
-2 votes
1 answer
182 views

Your challenge is to parse nonsensical text and output a "congruous phrase" - which I shall define here to be text with any contiguous characters in between, and including, a given set of like symbols ...
john321's user avatar
  • 19

15 30 50 per page