SRL Archive - SRL Bugs

Text.scar additions.


Frement

2010-12-14 07:10:35

{*******************************************************************************
function IsUpTextEx(Text: String): Boolean;
By: Frement
Description: Checks for UpText using wildcards.
Example: IsUpTextEx('?tt?ck???bl?n');
*******************************************************************************}
function IsUpTextEx(Text: String): Boolean;
begin
Text := Replace(Text, '?', '.');
Result := ExecRegExpr('.*'+Text+'.*', GetUpText);
end;

{*******************************************************************************
function IsUpTextRe(RegEx: String): Boolean;
By: Frement
Description: Checks for UpText using regular expressions.
Example: IsUpTextRe('.*tt.ck.*blin.*');
*******************************************************************************}
function IsUpTextRe(RegEx: String): Boolean;
begin
Result := ExecRegExpr(RegEx, GetUpText);
end;

The functions are pretty self-explanatory.

Gu3st...

2010-12-14 07:56:18

What does ExecRegExpr do?

Frement

2010-12-14 07:58:35

From: Zyt3x
What does ExecRegExpr do?


Compare given regular expression with given string. And returns true/false whether the regexp was successful or not.

Quickmarch

2010-12-14 08:29:14

http://villavu.com/forum/showthread.php?t=56288

Frement

2010-12-14 08:35:22

From: Quickmarch
http://villavu.com/forum/showthread.php?t=56288


Yes I know, this might be the original idea, and the place where I read it.

Coh3n

2010-12-30 01:51:30

Committed. :)