Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
QRegularExpressions not matching
chabor last edited by
I'm trying to use QRegularExpressinos to match any URL in a larger string.
My regex is:
Testing it out on sites like regex101 works, but in Qt it won't match.
I'm also using the same options i.e. /i /g.
Do i have to format it differently?
webzoid last edited by webzoid
I've only done a little bit of work with regular expressions in Qt. Just checking, you've used escape characters within your expression? Like '\\b' instead of '\b'
chabor last edited by chabor
@webzoid Yep I'm pretty sure I escaped everything I need to, like the double-slash and literal dots.
Edit: Oh god I forgot to escape my "\b" at the beginning. You're right, thank you.
But for some reason regex101 didn't care. Whelp.
You can use the regular expression example tool to check your regexp as well as get the escaped version for your code.