Skip to main content

Questions tagged [parsing]

This tag denotes challenges where parsing input is a large / the main part of the challenge.

Filter by
Sorted by
Tagged with
7 votes
7 answers
558 views

Build the first 6 letters of an Italian codice fiscale (tax identification number)

Given a single string with a person's name and surname, output the first 6 characters of their codice fiscale. Codice fiscale Codice fiscale is a 16-character long alphanumeric string that identifies (...
Nicola Sap's user avatar
  • 3,685
9 votes
14 answers
793 views

Convert CSV tables to MediaWiki tables

Input a CSV table, like this: data00,data01,data02,...,data0m data10,data11,data12,...,data1m ... datan0,datan1,datan2,...,datanm The cells in the CSV table is ...
None1's user avatar
  • 1,065
12 votes
3 answers
1k views

HTML Table Parser

Input a strict subset of HTML <table> string representation as defined below. Output parsed table, while any cells who span multiple rows or columns, record ...
tsh's user avatar
  • 34.9k
11 votes
12 answers
752 views

Rockstar Poetic Number Literals!

The Rockstar programming language has "poetic number literals", allowing you to assign nonnegative, finite (at least one Rockstar interpreter supports infinity) numbers to variables without ...
3-1-4-One-Five's user avatar
2 votes
2 answers
811 views

Compiler for LaTeX

Problem: Given a string representing a mathematical expression with constants (pi, e, psi, i), basic arithmetic operations (+, -, *, /), parentheses, fractions, and exponentiation, write a program or ...
3.14's user avatar
  • 383
8 votes
11 answers
2k views

Shortest path to open a letter lock

This quite literally came to me in a dream. A common combination padlock design has letters on the dials so you can set the combination to a word. Unfortunately, I can't read, but I can count. ...
pacman256's user avatar
  • 4,135
23 votes
12 answers
6k views

How long is this string, really?

In most programming languages, the string Hello, World! can be represented as "Hello, World!". But if you want to ...
emanresu A's user avatar
  • 38.8k
10 votes
6 answers
739 views

Convert from Spoken Binary

This is an exact inverse of the question Convert to Spoken Binary. This introduction is copied from there. Introduction In the video the best way to count, binary is proposed as the best system of ...
Tbw's user avatar
  • 2,083
14 votes
17 answers
3k views

What's the character limit of this text field? [duplicate]

Someone I know has no coding experience, but has proposed an algorithm* to determine the character limit of text fields they find online. They copy a string containing the numbers from 1 to 1,000 ...
Luke Sawczak's user avatar
0 votes
1 answer
83 views

Parse nested absolute values 2 [duplicate]

Looking at Arnauld's answer, it seems like this version is not really more difficult than the other version, so I made it an optional requirement of the other challenge The absolute value of a number \...
bsoelch's user avatar
  • 6,035
14 votes
7 answers
834 views

Parse nested absolute values

The absolute value of a number \$x\$ is normally written as \$|x|\$. The left and right side of the absolute value uses the same symbol, so it is not immediately obvious how to parse nested absolute ...
bsoelch's user avatar
  • 6,035
13 votes
11 answers
2k views

Ungolf the Wind

Weather conditions at airports are reported to pilots in METAR (METeorological Aerodrome Report) format. This format could be described as being "golfed." Here are some examples: ...
Someone's user avatar
  • 1,620
6 votes
0 answers
274 views

Write a proof checker for first order logic

This originally came from Give the best Chaitin incompleteness bound, but I realized that there was a fragment of this problem which still potentially gives a good coding challenge. First Order Logic ...
Charles Wang's user avatar
8 votes
3 answers
626 views

Expand Emmet HTML Abbreviations

Emmet is a text-editor and IDE plugin for writing HTML code using much fewer keypresses. You might think of it like a code-golfing HTML preprocessor. Its syntax is based on CSS selectors. Your ...
noodle person's user avatar
13 votes
4 answers
532 views

Golf a LaTeΧ math expression

A problem I sometimes encounter is that when writing comments using LaTeX, the comment is too long. Today you will solve this, by writing code which, given a LaTeX math expression, will produce the ...
Command Master's user avatar
22 votes
19 answers
3k views

Is it an Element?

𝖧ello all, I hope this finds you well. There are 118 elements on the Periodic table at the moment, each one corresponds to the number of protons in an atom's nuclei. Each element also has a 'symbol'. ...
tuskiomi's user avatar
  • 3,831
16 votes
6 answers
3k views

Is it a valid Go type?

Write the shortest program or function that will determine if an input is a valid Go type. Spec This challenge will use the following simplified subset of Go types. For more information, see the ...
bigyihsuan's user avatar
  • 9,786
16 votes
18 answers
2k views

Get all URLs on an HTML webpage

This is a rewrite of the (currently closed) "Debunking Stroustrup's debunking of the myth “C++ is for large, complicated, programs only”" challenge. Challenge Write the shortest program or ...
bigyihsuan's user avatar
  • 9,786
10 votes
12 answers
2k views

Calculate Bloons RBE

In Bloons Tower Defense 6, the strength of different bloons can be measured by their Red Bloon Equivalent (RBE), or the number of single pops it takes to completely defeat the bloon. The RBE for the ...
evanstar3's user avatar
  • 378
11 votes
10 answers
2k views

Parse a CSV file

In this challenge, given a CSV file as a string, you'll return the data contained as a 2d array of strings. Spec: The input consists of one or more records, delimited with ...
Borkbot's user avatar
  • 111
20 votes
12 answers
2k views

Recognize a counting tree

Let a counting tree be a rooted tree in which every node is labeled with the number of descendants it has. We can represent such trees as ragged lists with each node being represented by a list ...
Wheat Wizard's user avatar
  • 98.8k
13 votes
9 answers
1k views

Translate to plorcly borglar

plorcly borglar is a "mod" created by jan Misali for the constructed language toki pona that makes words sound funny. It involves substituting the 14 toki pona letters for funnier versions ...
Wheat Wizard's user avatar
  • 98.8k
12 votes
9 answers
1k views

Parse basic arithmetic into an AST

Introduction An abstract syntax tree (AST) is a tree of tokens that shows their connection to each other and syntactical meaning. They are commonly used in compilers and static analysis tools, as ...
Michael M.'s user avatar
14 votes
7 answers
767 views

Implement Casio's M

The task Most Casio calculators featured a variable M, which has 3 operators related to it: M, ...
oeuf's user avatar
  • 1,823
7 votes
5 answers
931 views

Fastest Gematria calculator

Gematria is an ancient Jewish method to determine a numeric value of a letter sequence, using a fixed value for each letter. Gematria is originally applied to Hebrew letters, but for the context of ...
The Shwarma's user avatar
24 votes
24 answers
2k views

Decipher a squashed sequence

Given a string containing a sequence of ascending consecutive positive integers, but with no separators (such as 7891011), output a list of the separated integers. ...
pxeger's user avatar
  • 23.9k
18 votes
25 answers
2k views

Is it a valid list?

Given a string like [[[],[[]]],[]], made of only commas and square brackets, your challenge is to determine whether it represents a list. A list is either: ...
emanresu A's user avatar
  • 38.8k
15 votes
11 answers
792 views

Determine Uilta Pitch Accent

Uilta is a minority tungusic language spoken in the far east of Russia. A neat thing about Uilta is that it has pitch accent which can be predicted by a computer program. In this challenge we are ...
Wheat Wizard's user avatar
  • 98.8k
41 votes
40 answers
6k views

Eh, codegolf shmodegolf

This challenge is about implementing Shm-reduplication, originating in Yiddish, where one takes a word, duplicates it, and replaces the first syllable in the second word with "Shm" in order ...
JSorngard's user avatar
  • 963
24 votes
20 answers
5k views

Is this expression Python 2/3 safe?

Given an expression like 4 / 2 + 3, determine whether the expression has the same value in Python 2 and Python 3. Recall that in Python 2 division rounds down (so ...
Sisyphus's user avatar
  • 14.8k
14 votes
5 answers
743 views

Is this propositional formula an instance of an axiom?

Please help me automate my discrete mathematics homework. Given a valid propositional formula, check if it is an instance of one of Łukasiewicz's axioms. Here's how it works. A term can be defined ...
KeizerHarm's user avatar
  • 1,373
9 votes
5 answers
355 views

Convert the type modifiers from prefix to C-fix

Given a base type T, this can be augmented with * or [], each meaning pointer and array. For ...
xiver77's user avatar
  • 2,365
4 votes
9 answers
1k views

int, float or neither?

Given a string, determine if it is an int, a float or neither. Examples 123 - int 62727.0033 - float 644c.33 - neither Your code should output a different value depending on which it is. For example ...
user avatar
25 votes
5 answers
1k views

Ungolf my tinylisp code

I like golfing in tinylisp: (d M(q((x)(i x(i(disp x)0(M x))0 But I also like posting explanations with nicely formatted code: ...
DLosc's user avatar
  • 39.7k
8 votes
4 answers
230 views

Split along groups (hard mode)

This is an alternate version of this earlier challenge with a twist that adds a significant bit of difficulty. Like last time, you are going to be given a string containing some alphabetic characters ...
Wheat Wizard's user avatar
  • 98.8k
19 votes
10 answers
540 views

Split along groups

You are going to be given a string containing some alphabetic characters along with [ and ]. Your task is to split into ...
Wheat Wizard's user avatar
  • 98.8k
14 votes
11 answers
716 views

AoCG2021 Day 20: Wonky license check

Part of Advent of Code Golf 2021 event. See the linked meta post for details. Related to AoC2018 Day 8. The license file for an imaginary software system is defined as follows: The entire file is a ...
Bubbler's user avatar
  • 77k
11 votes
3 answers
309 views

Is it a valid line in "Girls & Boys"?

Intro Blur's song Girls & Boys featured the lines girls who are boys who like boys to be girls who do boys like they're girls, who do girls like they're boys ...
sugarfi's user avatar
  • 2,203
14 votes
15 answers
1k views

Fully matched numbers

For the context of this challenge, a matched group is a digit \$n\$, followed by \$n\$ more matched groups. In the case of \$n = 0\$, that's the whole matched group. Digits only go up to 9. For ...
emanresu A's user avatar
  • 38.8k
16 votes
18 answers
964 views

AoCG2021 Day 11: Garbageful streams

Part of Advent of Code Golf 2021 event. See the linked meta post for details. Related to AoC2017 Day 9. Weekends are Bubbler's days off from posting these lol A large stream blocks your path. ...
lyxal's user avatar
  • 33.6k
11 votes
16 answers
892 views

Cartesian literal notation

Introduction In computer science, a literal is a notation for representing a fixed value in source code. Almost all programming languages have notations for atomic values, some also have notations ...
obnews's user avatar
  • 211
27 votes
24 answers
3k views

Convert prefix to infix

Infix notation is a method of printing mathematical expressions where each operator sits between its two arguments, such as \$ \left(5 \cdot 4\right) + 3 \$. Prefix notation is a method of printing ...
emanresu A's user avatar
  • 38.8k
3 votes
2 answers
232 views

Tips for parsing Standard Input in JavaScript

I've been doing quite a few code golf recently and I realised that a lot of times, I have to do something involving list. Most of the times lists are space-separated or comma-separated values in the ...
CreaZyp154's user avatar
29 votes
31 answers
3k views

Open or Close the Parentheses

Every phone needs a calculator app. Because of the limited screen real estate, the developer of mine has decided to save some buttons. Instead of having two dedicated bracket buttons - one for open <...
Jitse's user avatar
  • 7,324
19 votes
12 answers
2k views

How many values of this type?

Background The number of values for a given type is called the cardinality of that type, and that of type T is written as |T|. Haskell and a few other languages ...
Bubbler's user avatar
  • 77k
17 votes
22 answers
2k views

Parentheses Clusters

Write a program that groups a string into parentheses cluster. Each cluster should be balanced. Examples : ...
MSS2001's user avatar
  • 339
15 votes
8 answers
1k views

Simplify K projections

Background K functions have a feature called projection, which is essentially partial application of values to a function. The syntax for projections is a natural extension of the regular function ...
Bubbler's user avatar
  • 77k
21 votes
31 answers
2k views

Remove oddly nested substrings

Task: Input will consist of some text, with nested [] separating some of it into nested groups: ...
Rydwolf Programs's user avatar
11 votes
5 answers
531 views

Parse Ternary Lambda Calculus for correctness

Wheat Wizard has once tried to come up with a parsing problem unsuitable for regex, but it failed due to Anders Kaseorg's Perl regex answer. This is the second attempt. Now that we know that Perl ...
Bubbler's user avatar
  • 77k
25 votes
5 answers
1k views

Parse a lambda for correctness

The goal of this challenge is to fill a niche that is mostly lacking on this site. In my observations there most parsing verification challenges fall into two categories: Super easy parsing. This ...
Wheat Wizard's user avatar
  • 98.8k

1
2 3 4 5 6