Home > Software design >  Why does std::regex_match generate different results
Why does std::regex_match generate different results

Time:09-16

I'm trying to use std::regex to validate some variables from a file in my c 11 project.

For now I need to validate if a string is a valid URL or not. Here is my code: enter image description here

I really don't know why.

My server is Ubuntu 16.04.4 LTS, and the version of GCC is 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.11).

CodePudding user response:

Must be a compiler thing, compiling on gcc5.4 with -Wformat -std=c 17, and then running it also returns 0.

https://godbolt.org/z/a8o9x9nWP

Probably best if you update your compiler to a newer version.

  • Related