{
  "id": 8065929,
  "title": "Labeled matches: why is this not in every regex engine?",
  "url": "https://urgent.news/2026/09/17/labeled-matches-why-is-this-not-in-every-regex-engine",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-09-17T16:44:39.000Z",
  "source": {
    "name": "Lobsters",
    "slug": "lobsters",
    "url": "https://iev.ee/blog/categorize-everything-all-at-once/"
  },
  "original_language": "en",
  "account": "In the world of computer science, regular expressions (regex) are often employed as an approximate \"good enough\" tool, despite their expressivity being insufficient for parsing HTML. This time, the yyyy-MM-dd format represents a regular language, meaning it's possible to reliably and precisely determine if something is a date or not using regex, even accounting for leap years. This is a significant advantage over using neural networks, which incur additional computational costs without providing any inherent benefits.\n\nThe provided patterns demonstrate how to label different elements, such as names and dates, using regex. The NAME pattern uses & for intersection and ~ for complement operators, similar to AND and NOT functions. By combining these operators, complex boolean logic can be expressed within pure regex, enabling accurate identification of elements without the need for additional computational resources.\n\nA practical example showcases a 24,504-character regex pattern designed to parse the Gregorian calendar, including rules for leap years. Despite its size, this pattern compiles into only 24,504 states, which is a more efficient representation than the algebraic expansion of the same rules using only union and concatenation operations. This approach leverages the power of state machines to perform complex pattern matching with minimal computational overhead.",
  "summary": null,
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}