valum icon indicating copy to clipboard operation
valum copied to clipboard

Invalid regular expression

Open jtojnar opened this issue 2 years ago • 7 comments

Building Valum on Nix with GNOME 43 fails:

../src/valum/valum-router.vala:50.30-50.49: error: Invalid regular expression `//(?:\.?[\w-\s\/@+~])+'.
   50 |                         register_type ("path",   /(?:\.?[\w-\s\/@+~])+/);
      |                                                   ^~~~~~~~~~~~~~~~~~~~   

Likely due to GLib switching to PCRE 2: https://gitlab.gnome.org/GNOME/glib/-/issues/2706

jtojnar avatar Sep 23 '22 13:09 jtojnar

I'll try to take a look this week. The regex pretty mundane though.

arteymix avatar Sep 25 '22 00:09 arteymix

Does /(?:\.?[\w\s\/@+~])+/ accomplish the same thing?

yerodin avatar Nov 22 '22 17:11 yerodin

@yerodin It's lacking hyphens in the path-like characters. Maybe the solution is to escape the hyphen?

Something like /(?:\.?[\w\-\s\/@+~])+/. I'm so sorry I don't have the time to test this right now.

arteymix avatar Nov 22 '22 18:11 arteymix

Ahh I see, seems to be working well so far :)

yerodin avatar Nov 22 '22 21:11 yerodin

@yerodin Would you like to submit a PR with the fix?

arteymix avatar Nov 22 '22 21:11 arteymix

Sure! I'd be honored, let me just skim through the guide real quick

yerodin avatar Nov 22 '22 22:11 yerodin

All good

yerodin avatar Nov 22 '22 22:11 yerodin