For the line stop("regex_test error: number of arguments should be exactly 2 or 3!") in regex_test.f90 and if (classend.eq.0) stop("No terminating char class") in fexp.f90 there should be space after stop. You can also remove the parentheses.