Regular expressions in LaTeX using the l3regex package. Since June 2017, the l3regex package is included in the LaTeX3 kernel code which is loaded by the expl3 package in LaTeX or expl3-generic in other formats.
l3regex is the name of a module in the expl3 kernel (for the future LaTeX3, but already usable) designed for playing with regular expressions. It features a syntax similar to the POSIX standard, with adaptations for LaTeX.
Until June 2017 it used to be necessary to explicitly load it with \usepackage{l3regex}. The June 2017 release of expl3 included the module in the kernel.