# Regexp performances and Finite Automata

DevFeed: [Regexp performances and Finite Automata](<https://devfeed.tech/articles/regexp-performances-and-finite-automata-34389.md>)

Original publisher: [Read original article](<https://tapoueh.org/blog/2010/09/regexp-performances-and-finite-automata/>)

Author: Dimitri Fontaine PostgreSQL Major Contributor; Author

Published: 2010-09-26T19:00:00Z

Content type: article

Language: en

Sources: [Dimitri Fontaine](<https://devfeed.tech/sources/dimitri-fontaine.md>)

Topics: [Automaton](<https://devfeed.tech/topics/automaton.md>), [Regular expression](<https://devfeed.tech/topics/regular-expression.md>), [Parser](<https://devfeed.tech/topics/parser.md>), [PostgreSQL](<https://devfeed.tech/topics/postgresql.md>), [Perl](<https://devfeed.tech/topics/perl.md>), [Ruby](<https://devfeed.tech/topics/ruby.md>), [Emacs](<https://devfeed.tech/topics/emacs.md>)

Tags: [dfa](<https://devfeed.tech/tags/dfa.md>), [emacs-lisp](<https://devfeed.tech/tags/emacs-lisp.md>), [perl](<https://devfeed.tech/tags/perl.md>), [postgresql](<https://devfeed.tech/tags/postgresql.md>), [regexp](<https://devfeed.tech/tags/regexp.md>), [regular-expressions](<https://devfeed.tech/tags/regular-expressions.md>), [ruby](<https://devfeed.tech/tags/ruby.md>)

## AI overview

This article examines regular-expression performance through the lens of finite automata, contrasting NFA and DFA-based implementation techniques. It also discusses PostgreSQL's regular-expression implementation and the author's preference for using awk in some file-searching situations.

## Source excerpt

The major reason why I dislike perl so much, and ruby too, and the thing I'd want different in the Emacs Lisp API so far is how they set developers mind into using regexp. You know the quote, don't you? Some people, when confronted with a problem, think "I know, I'll use regular expressions." Now they have two problems. That said, some situations require the use of regexp -- or are so much simpler to solve using them than the maintenance hell you're building here ain't that big a drag. The given expressiveness is hard to match with any other solution, to the point I sometime use them in my code (well I use rx to lower the burden sometime, just see this example).