Skip to content

Fix parsing and tests#58

Merged
Be-ing merged 2 commits into
Be-ing:qregularexpressionfrom
uklotzde:qregularexpression
Sep 18, 2021
Merged

Fix parsing and tests#58
Be-ing merged 2 commits into
Be-ing:qregularexpressionfrom
uklotzde:qregularexpression

Conversation

@uklotzde
Copy link
Copy Markdown

No description provided.

namespace {
const QRegularExpression kDurationRegex(QStringLiteral("^(\\d*)(m|:)?([0-6]?\\d)?s?$"));
const QRegularExpression kNumericOperatorRegex(QStringLiteral("^(>|>=|=|<|<=)(.*)$"));
const QRegularExpression kDurationRegex(QStringLiteral("^(\\d+)(m|:)?([0-5]?\\d)?s?$"));
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was the change from 0-6 to 0-5 intentional?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, :00-:59 is the valid range. I also added a test that checks that :60 is not accepted.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The regex was wrong and no one ever noticed.

@Be-ing
Copy link
Copy Markdown
Owner

Be-ing commented Sep 18, 2021

Thank you for digging into this.

@Be-ing Be-ing merged commit f565770 into Be-ing:qregularexpression Sep 18, 2021
@uklotzde uklotzde deleted the qregularexpression branch September 19, 2021 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants