Introduction to Qt Widgets (Part 33) - Regular Expressions

Опубликовано: 27 Октябрь 2025
на канале: KDAB
667
15

Regular expressions is a very powerful tool to parse strings and validate user input. Qt has support for regular expressions via the class QRegularExpression and its helpers.

Links:
Qt Widgets and More episode on Clang Tidy and Clazy:    • Running clang-tidy and clazy from Qt Creator  

Episode telling about validating input    • Introduction to Qt Widgets (Part 27) - Val...  

Mastering Regular Expressions (Third Edition) by Jeffrey E. F. Friedl, ISBN 0-596-52812-4;

Regular expressions supported: https://pcre.org/original/doc/html/pc...

The example code showcased in this video is available here: https://github.com/KDABLabs/kdabtv/tr...

0:00 Introduction
1:29 QRegularExpression class
3:15 Code example & discussion
5:55 QRegularExpression pattern
7:25 Tips and tricks
11:48 QRegularExpression capture
15:46 KDAB Platforms Services
16:09 QRegularExpressionMatchIterator
17:51 Conclusion

All 'Introduction to Qt Widgets - Module 1' videos:    • Introduction to Qt Widgets - Module 1: Fir...  

All 'Introduction to Qt Widgets - Module 2' videos:
   • Introduction to Qt Widgets - Module 2: Qt ...  

All 'Introduction to Qt Widgets - Module 3' videos:
   • Introduction to Qt Widgets - Module 3: The...  

All 'Introduction to Qt Widgets - Module 4' videos:
   • Introduction to Qt Widgets - Module 4: Top...  

All 'Introduction to Qt Widgets - Module 5' videos:
   • Introduction to Qt Widgets - Module 5: Cor...  

About the host:
The video is presented by Jesper Pedersen, who started with Qt back when Qt was widgets only and the version was 1.44, which gives him 21 years of experience with Qt. Since 2000 he has taught almost 100 Qt classes, ranging from Qt Widgets to QML. Heck, Jesper even taught a few classes on QTopia Core — Trolltech's initial attempt at creating a phone stack. Today Jesper holds a fancy business title, but that doesn't prevent him from coding both in his job and in his spare time.

Every month our newsletter is featuring technical blogs on Qt, C++ and 3D topics: https://www.kdab.com/development-reso...

About KDAB:
KDAB offers experienced software experts to help you deliver functional, high-performing and innovative software across embedded, mobile and desktop platforms for projects using C++, Qt, QML/Qt Quick, OpenGL, Qt 3D and more. https://www.kdab.com/software-services

KDAB experts regularly take time out to deliver KDAB’s world class training, in-house or at open enrolment courses around the world. We are the market leaders for training in Qt, OpenGL and C++.

Contact us to find out more at [email protected] or visit our website: https://www.kdab.com/software-service...

We are over 100 people, located all around the world. Our Head Office is in Sweden and we have other offices in Germany, France, the UK and the USA. https://www.kdab.com/about/contact/