browserchooser 0.0.2
A simple browser chooser.
Loading...
Searching...
No Matches
domainmatch.h File Reference
#include <QtCore/QString>
Include dependency graph for domainmatch.h:

Go to the source code of this file.

Functions

bool matchesWildcardPattern (const QString &pattern, const QString &domain)

Function Documentation

◆ matchesWildcardPattern()

bool matchesWildcardPattern ( const QString & pattern,
const QString & domain )
nodiscard

Returns true if domain matches the wildcard pattern. Special handling for *. prefix: matches any subdomain and the bare domain (e.g. *.google.com matches www.google.com, mail.google.com, google.com). Other patterns use QRegularExpression wildcard conversion (case-insensitive).

Parameters
patternThe pattern (e.g. .example.com or *..example.com).
domainThe domain to match.