Quickmarch
2010-04-21 14:28:48
Thought it might be cool to incorporate regular expressions into uptext finding as it would possibly make it more accurate. This could also be applied to any function that uses text finding (ChooseOption, etc).
Atm, it only works on SCAR as simba does not support regex' yet.
Feedback pl0x. :)
const
Pattern = 'U?se ?B?ank ?B?ooth'; //Probably not the best pattern
function IsUpTextRegex(Exp: String; CaseSensitive: Boolean): Boolean;
{$IFNDEF Simba}
var
uptext: String;
begin
uptext := GetUpText;
if (not (CaseSensitive)) then
begin
Exp := Lowercase(Exp);
uptext := Lowercase(uptext);
end;
Result := RegexPos(uptext, Exp) > 0;
{$ELSE}
begin
WriteLn('Not yet supported in simba.');
{$ENDIF}
end;
Atm, it only works on SCAR as simba does not support regex' yet.
Feedback pl0x. :)