Fix build with GLib 2.20

Don't use `g_regex_get_compile_flags()` that is new in 2.26, but we
only depend on 2.20.

Closes #340.