where it supports * and ? and # (number) and other Unix Grep-like patterns.
> Hi, I am looking for a function in which you can search a string using
> wildcards such as "*". For instance in the text search string "*cat*", the
> following words would be found as matching:
> cat
> catnip
> alleycat
> nocategory
> etc.......
> I'm using VB5. The search sub I am using looks only for exact matches,
here
> is the code:
> Private Sub FindText(ByVal start_at As Integer)
> Dim pos As Integer
> Dim target As String
> target = txtTarget.Text
> pos = InStr(start_at, txtBody.Text, target)
> If pos > 0 Then
> ' We found it.
> TargetPosition = pos
> txtBody.SelStart = TargetPosition - 1
> txtBody.SelLength = Len(target)
> txtBody.SetFocus
> Else
> ' We did not find it.
> MsgBox "Not found."
> txtBody.SetFocus
> End If
> End Sub
> Any help is appreciated.
> Thanks,
> Tim Hirtle
> -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
> http://www.*-*-*.com/ - The #1 Newsgroup Service in the World!
> -----== Over 80,000 Newsgroups - 16 Different Servers! =-----