valum-framework / valum

Web micro-framework written in Vala
https://valum-framework.readthedocs.io/en/latest/
GNU Lesser General Public License v3.0
226 stars 23 forks source link

Invalid regular expression #238

Open jtojnar opened 2 years ago

jtojnar commented 2 years ago

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

arteymix commented 2 years ago

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

yerodin commented 1 year ago

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

arteymix commented 1 year ago

@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.

yerodin commented 1 year ago

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

arteymix commented 1 year ago

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

yerodin commented 1 year ago

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

yerodin commented 1 year ago

All good