//Continue testing next char... Inc(aSource); Inc(aPattern); end; '[': begin //Match given set of chars. if (aPattern[1] in [#0,'[',']']) then begin //Invalid Set - So no match. Result := False; Exit; end; if (aPattern[1] = '^') then begin //Match for exclusion of given set... Inc(aPattern, 2); Result := True; while (aPattern[0] <> ']') do begin if (aPattern[1] = '-') then begin //Match char exclusion range. if (aSource[0] >= aPattern[0]) and (aSource[0] <= aPattern[2]) then begin //Given char failed set exclusion range. Result := False; Break; end else Inc(aPattern, 3); end else begin //Match individual char exclusion. if (aSource[0] = aPattern[0]) then begin //Given char failed set element exclusion. Result := False; Break; end else |