Regex map?

  • Thread starter Thread starter George Ter-Saakov
  • Start date Start date
G

George Ter-Saakov

Hi.

I need some info where to look for following data object (aka map).

It acts as a map but accept a Regexp as a key. (support of * and ? will be
sufficient).
So if i try look for string it should return most suitable pair.

Example:
I loaded my map with following keys "test", "test\*", "test1"

So result from search of "test" will be first pair.
result from search of "test\dir" will be second pair.
And result from search of "dir" will be null



Thanks.
George.
 
Hi George,


Thank you for using Microsoft Newsgroup Service. Based on your description,
you are looking for a collection object which act as a map collection and
support regex key search. Is my understanding correct?

As for the collections in dotnet class Libraray, they are all under the
System.Collections namespace. However, currently there hasn't been such a
map collection that support regex key search. Is the class you are looking
for writen via dotnet or any other language? Have you ever used it before?
BTW, there is also a rich regex class library in dotnet framework which is
under the "System.Text.RegularExpressions" namespace, you may have a look
to see whether they'll be helpful to you.


Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
Thanks for the response.
I think you got my problem 100% correctly.
I do know about System.Collection namespace and a
System.Text.RegularExpression.
I can always implement the collection i am looking for just by iterating
through all the keys with search perfomance O(N)

But I would like to have Collection with search perfomance more like a
Hashtable.

I was thinking that such thing might already exist written by someone in one
of .NET languages.
But not sure that it's possible at all to come up with Hash key for RegEx.

George.
 
Back
Top