17
3
Recently, the PPCG design leaderboard has been having some trouble parsing answer html headers.
In this challenge you'll be taking your own shot at parsing answer headers.
Example Test Cases
These example inputs (NOT actual test cases), just so you can get the idea of how inputs might be like
Input: <h1>Python 3, 32 bytes</h1>
Desired Output: Python 3
Input: <h1>JavaScript, 13 chars / 32 bytes</h1>
Desired Output: JavaScript
Input: <b>VeryBadlyFormattedHeader v3 : (32 bytes)</b>
Spec
Your program should be 150 bytes or below
You will be given a line of an answer header's html, you'll need to try to do your best to successfully extract the language. Input may contain unicode characters.
Output case matters.
Tests
There is one test case per line. The format is:
<lang_name> - <rest_of_the_line_is_the_header>
Scoring
Your score is:
Number Correct
----------------
Total Number
(which is a percent)
Tie-breaker is shortest code.
There should be a tie-breaker like shortest code since 100% score is very achievable. – user81655 – 2016-01-23T07:15:18.047
1The most common header style
#
is not even present in the test cases ?! – edc65 – 2016-01-23T08:20:07.273So the language is typically the first word the the input? – TanMath – 2016-01-23T09:43:43.643
@edc65 I believe this is about parsing the HTML output of the answer, not the Markdown source. – Kroltan – 2016-01-23T15:11:17.000
@Kroltan uh thanks for clarifying – edc65 – 2016-01-23T15:15:37.177
5Parsing HTML with regex? Whatever next? – Neil – 2016-01-23T20:22:18.190
You should have made them output the byte number as well, that's been causing us just as much trouble... – ETHproductions – 2016-01-24T03:16:43.477
@ETHproductions That could be made into a separate challenge considering its different enough – Downgoat – 2016-01-24T03:17:36.913
I would highly recommend changing the tie-breaker from shortest code to earlier submission. Here's why.
– Mego – 2016-01-24T21:40:21.893