this looks awful but i found this article a while ago and kept it...
String Pattern Matching
The islike function take 2 strings and compare them using simple pattern
matching. Only '*' and '?' are implemented, range syntaxe '[]' are not
implemented.
Exemple : islike('abcdxabcdxabcdefg',
RegEx is definitely the best way to do it.
TRegExpr library
Regular Expressions for Delphi
Author:
Andrey V. Sorokin
St-Petersburg
Russia
[EMAIL PROTECTED], [EMAIL PROTECTED]
http://anso.da.ru
http://anso.virtualave.net
-Original Message-
From:
July 2003 5:26 PM
To: Multiple recipients of list delphi
Subject: RE: [DUG]: Wildcard match of strings
Use the TMask object. Here is a function I use.
function Matches(const S,Wildcard: String): Boolean;
var
Mask: TMask;
begin
Mask := TMask.Create(Wildcard);
Result := Mask.Matches(S
probably not the best option, but you could use pos and check the result
HTH
Chris
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Behalf Of Allan, Samuel
Sent: Tuesday, 1 July 2003 4:40 p.m.
To: Multiple recipients of list delphi
Subject: [DUG]: Wildcard
I recommend you get a free component for parsing regular expressions :)
Try going to Torry:
http://www.torry.net/text.htm
Stephen
-Original Message-
From: Allan, Samuel [mailto:[EMAIL PROTECTED]
Sent: Tuesday, 1 July 2003 4:40 p.m.
To: Multiple recipients of list delphi
Subject:
Use the TMask object. Here is a function I use.
function Matches(const S,Wildcard: String): Boolean;
var
Mask: TMask;
begin
Mask := TMask.Create(Wildcard);
Result := Mask.Matches(S);
Mask.Free;
end;
Eg. If Matches('I am Roger',*Roger*) then...
Ross Levis.
-Original Message-
Thanks very much guys. Problem solved.
-Original Message-
From: Ross Levis [mailto:[EMAIL PROTECTED]
Sent: Tuesday, 1 July 2003 5:26 p.m.
To: Multiple recipients of list delphi
Subject: RE: [DUG]: Wildcard match of strings
Use the TMask object. Here is a function I use.
function
PROTECTED]
To: Multiple recipients of list delphi [EMAIL PROTECTED]
Sent: Tuesday, July 01, 2003 5:26 PM
Subject: RE: [DUG]: Wildcard match of strings
Use the TMask object. Here is a function I use.
function Matches(const S,Wildcard: String): Boolean;
var
Mask: TMask;
begin
Mask := TMask.Create