Themata.AI
Themata.AI

Popular tags:

#developer-tools#ai-agents#llms#claude#ai-ethics#code-generation#ai-safety#openai#anthropic#discussion

AI is changing the world. Don't stay behind. Clear summaries, community insight, delivered without the noise. Subscribe to never miss a beat.

© 2026 Themata.AI • All Rights Reserved

Archive

|

Topics

|

Privacy

|

Cookies

|

Contact
developer-toolsprogrammingregular-expressionshtml-parsing

The true power of regular expressions (2012)

The true power of regular expressions

npopov.com

August 3, 2026

21 min read

🔥🔥🔥🔥🔥

46/100

Summary

Regular expressions can be effective for parsing specific aspects of HTML, despite the common belief that HTML is not regular. Using regular expressions in certain contexts can yield practical results, challenging the notion that XML parsers are the only viable solution.

Key Takeaways

  • Regular expressions can match more than just regular grammars; modern implementations can handle complex patterns beyond the formal definition of regularity.
  • The grammar defining natural numbers can be expressed as a regular expression [0-9]+, demonstrating the conciseness of regex compared to traditional grammar definitions.
  • The article emphasizes that while formal regular expressions are limited to regular languages, practical regex implementations in programming languages can parse a wider range of patterns.
  • The Chomsky hierarchy is referenced to categorize different types of languages, highlighting the complexity of language parsing in computational theory.
Read original article

Community Sentiment

Mixed

Positives

  • Regex is compact and declarative, offering a unique solution to text processing that alternatives like substring searches simply can't match.
  • Despite its complexity, regex has a rich composability potential that many programming languages overlook, limiting its full utility.
  • For many practical applications, such as counting tags, regex proves effective even if it isn't suited for parsing entire documents.

Concerns

  • Reading regex can feel like deciphering a complex mathematical formula, making it daunting for many developers who struggle with its dense syntax.
  • The conflation of regex with specific implementations like PCRE misleads users about its true capabilities, especially regarding performance and complexity.
  • Regular expressions can be notoriously slow depending on how they are crafted, which can lead to significant performance issues in real-world applications.