forked from qt-creator/qt-creator
Git: Fix pattern for commit hash matching
* Avoid matching mid-word. * Avoid matching after "mode ". * Change to raw string literals. Fixes: QTCREATORBUG-24768 Fixes: QTCREATORBUG-28268 Change-Id: I68abbf3de7928c60e0fe2d944adedaa6db94b1a4 Reviewed-by: André Hartmann <aha_1980@gmx.de>
This commit is contained in:
committed by
Orgad Shaneh
parent
ae58d373b0
commit
7c623f99d8
@@ -29,7 +29,7 @@
|
|||||||
#include <QTextCodec>
|
#include <QTextCodec>
|
||||||
#include <QTextCursor>
|
#include <QTextCursor>
|
||||||
|
|
||||||
#define CHANGE_PATTERN "[a-f0-9]{7,40}"
|
#define CHANGE_PATTERN "\\b[a-f0-9]{7,40}\\b"
|
||||||
|
|
||||||
using namespace Core;
|
using namespace Core;
|
||||||
using namespace Utils;
|
using namespace Utils;
|
||||||
|
|||||||
@@ -21,10 +21,10 @@ namespace VcsBase {
|
|||||||
|
|
||||||
VcsOutputLineParser::VcsOutputLineParser() :
|
VcsOutputLineParser::VcsOutputLineParser() :
|
||||||
m_regexp(
|
m_regexp(
|
||||||
"(https?://\\S*)" // https://codereview.org/c/1234
|
R"((https?://\S*))" // https://codereview.org/c/1234
|
||||||
"|(v[0-9]+\\.[0-9]+\\.[0-9]+[\\-A-Za-z0-9]*)" // v0.1.2-beta3
|
R"(|\b(v[0-9]+\.[0-9]+\.[0-9]+[\-A-Za-z0-9]*))" // v0.1.2-beta3
|
||||||
"|([0-9a-f]{6,}(?:\\.{2,3}[0-9a-f]{6,}" // 789acf or 123abc..456cde
|
R"(|\b(?<!mode )([0-9a-f]{6,}(?:\.{2,3}[0-9a-f]{6,})" // 789acf or 123abc..456cde
|
||||||
"|\\^+|~\\d+)?)") // or 789acf^ or 123abc~99
|
R"(|\^+|~\d+)?)\b)") // or 789acf^ or 123abc~99
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user