In reverse engineering, parsing may be partially done to extract lightweight source models. Parsing code containing preprocessing directives, syntactical errors and embedded languages is a difficult task using context-free grammars. Several researchers have proposed some form of lexical analyzer to parse such code. We present a lightweight tool, called RegReg, based on a hierarchy of lexers described by tagged regular expressions. By using tags, the automatically generated parse tree can be easily manipulated. The ability to control the matching rulemechanismforeachregularexpressionincreasesefficiencyand disambiguation choices. RegRegis lightweight asitusesaminimalnumberof featuresandits implementation usesonly deterministic automaton.It ha...