Commit 452e895f authored by Tomaz  Canabrava's avatar Tomaz Canabrava
Browse files

Fix matching for files within folders

if we had a string in the form /data/thingy.jpg the only match would
be `data` because we did not took the folder separator into account
parent e7e8e9d1
...@@ -538,7 +538,11 @@ FileFilter::FileFilter(Session *session) : ...@@ -538,7 +538,11 @@ FileFilter::FileFilter(Session *session) :
* on the HotSpot creation we verify if this is indeed a file, so there's * on the HotSpot creation we verify if this is indeed a file, so there's
* no problem on testing on random words on the screen. * no problem on testing on random words on the screen.
*/ */
QLatin1String(R"('[^']+'|"[^"]+"|[\w.~:-]+)"), QLatin1String(
"'[^']+'" // Matches everything between single quotes.
R"RX(|"[^"]+")RX" // Matches everything inside double quotes
R"RX(|[\w\/.~:-]+)RX" // matches a contiguous line of alphanumeric characters plus some special ones.
),
QRegularExpression::DontCaptureOption); QRegularExpression::DontCaptureOption);
setRegExp(re); setRegExp(re);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment