# Regular expressions obfuscation under the microscope

DevFeed: [Regular expressions obfuscation under the microscope](<https://devfeed.tech/articles/regular-expressions-obfuscation-under-the-microscope-39688.md>)

Original publisher: [Read original article](<https://doar-e.github.io/blog/2013/08/24/regular-expressions-obfuscation-under-the-microscope/>)

Author: Axel "0vercl0k" Souchet

Published: 2013-08-24T19:35:00Z

Content type: tutorial

Language: en

Sources: [Diary of a reverse-engineer](<https://devfeed.tech/sources/diary-of-a-reverse-engineer.md>)

Topics: [obfuscation](<https://devfeed.tech/topics/obfuscation.md>), [Finite-state machine](<https://devfeed.tech/topics/finite-state-machine.md>), [Regular expression](<https://devfeed.tech/topics/regular-expression.md>), [Reverse Engineering](<https://devfeed.tech/topics/reverse-engineering.md>), [Assembly](<https://devfeed.tech/topics/assembly.md>), [C](<https://devfeed.tech/topics/c.md>)

Tags: [assembly](<https://devfeed.tech/tags/assembly.md>), [c](<https://devfeed.tech/tags/c.md>), [obfuscation](<https://devfeed.tech/tags/obfuscation.md>), [regex](<https://devfeed.tech/tags/regex.md>), [regular-expressions](<https://devfeed.tech/tags/regular-expressions.md>), [reverse-engineering](<https://devfeed.tech/tags/reverse-engineering.md>)

## AI overview

This tutorial explains how regular expressions can be compiled into finite-state machines and represented directly in assembly or C, making them harder to analyze. It demonstrates a simple manual implementation and discusses recognizing and obfuscating compiled regexes during reverse-engineering work.

## Source excerpt

Introduction Some months ago I came across a strange couple of functions that was kind of playing with a finite-state automaton to validate an input. At first glance, I didn't really notice it was in fact a regex being processed, that's exactly why I spent quite some time to understand ...