Regular expressions (regex) are characters sequences defining patterns which are used for searching, replacing in strings, or validating strings (e.g. is it a valid e-mail address?)… Many languages give access to regular expressions: Perl (whose library has become a reference), Python, C, C++, Java, Javascript, Ruby, TCL, PHP, Julia… And Fortran can also be interfaced with regex libraries.
I have just added a short regex example in gtk-fortran in the gtk3 and gtk4 branches. That example don’t use GTK itself (no GUI), but just some GLib functions:
https://github.com/vmagnin/gtk-fortran/blob/gtk3/examples/regex.f90
As you may know, GTK is based on the general purpose GLib library, which includes a regex API based on the PCRE library:
https://developer.gnome.org/glib/stable/glib-Perl-compatible-regular-expressions.html
In the fpm registry, you can also find (by @urbanjost):
See also its M_REGEX(3fm) for calling the POSIX Regular Expression library:
https://github.com/urbanjost/general-purpose-fortran
@interkosmos also proposes interfaces toward POSIX regular expressions:
Finally, some other Fortran regex codes can be found in GitHub:
https://github.com/search?q=fortran+regex