diff --git a/components/lazutils/masks.pas b/components/lazutils/masks.pas index 7255ea23e7..8b2f4d8f3b 100644 --- a/components/lazutils/masks.pas +++ b/components/lazutils/masks.pas @@ -951,8 +951,14 @@ begin end; '[': begin - if [mocSet,mocRange, - mocAnyCharOrNone] * fMaskOpcodesAllowed <> [] + if ([mocSet,mocRange, + mocAnyCharOrNone] * fMaskOpcodesAllowed <> []) + and not + ( + ([mocSet,mocRange]*fMaskOpCodesAllowed = []) //only mocAnyCharOrNone enabled + and + (fMaskInd<=fMaskLimit) and (fMask[fMaskInd+1]<>'?')// next char is not '?', so basically then the '[' is a literal (or an escapechar) + ) then CompileRange else begin