/* * This file is part of smolbote. It's copyrighted by the contributors recorded * in the version control history of the file, available from its original * location: git://neueland.iserlohn-fortress.net/smolbote.git * * SPDX-License-Identifier: GPL-3.0 */ #include "regexp.h" RegExp::RegExp(const QString &pattern, PatternOptions options) : QRegularExpression() { setPattern(pattern); setPatternOptions(options); } bool RegExp::hasMatch(const QString &subject, int offset, MatchType matchType, MatchOptions matchOptions) const { // Empty matches all if(pattern().isEmpty()) { return true; } return QRegularExpression::match(subject, offset, matchType, matchOptions).hasMatch(); } void RegExp::setWildcardPattern(const QString &pattern) { QString parsed; for(int i=0; i