473,395 Members | 1,454 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Wildcard pattern matching

I have noticed that in the directoryInfo class a method named GetFiles(String) accepts a wildcard pattern as a parameter and uses this to match file names that exist in a directory. I want to use the pattern matching agorithm it uses. Why is it not exposed to public access?

Thank you.
Nov 16 '05 #1
2 6434
> I have noticed that in the directoryInfo class a method named
GetFiles(String) accepts a wildcard
pattern as a parameter and uses this to match file names that exist in a directory. I want to use the pattern matching agorithm it uses. Why is it not exposed to public

access?

It isn't exposed because the algorithm lies in the file system.
However the best way to go will be certainly regular expressions.

--
cody

[Freeware, Games and Humor]
www.deutronium.de.vu || www.deutronium.tk
Nov 16 '05 #2
Iam not RegEx expert but I think you can simply replace * and ? with the
corresponding RexEx joker characters/sequences. Be sure that you escape
reserved regex characters/sequences in your string before passing it to a
regex method.

--
cody

[Freeware, Games and Humor]
www.deutronium.de.vu || www.deutronium.tk
"RobC" <Ro**@discussions.microsoft.com> schrieb im Newsbeitrag
news:E2**********************************@microsof t.com...
Thank you Cody! BTW, mimicking file search wildcard patterns with regex is no easy task. Is this already written somewhere? Thanks.

"cody" wrote:
I have noticed that in the directoryInfo class a method named

GetFiles(String) accepts a wildcard
pattern as a parameter and uses this to match file names that exist in
a directory. I want to use the
pattern matching agorithm it uses. Why is it not exposed to public

access?

It isn't exposed because the algorithm lies in the file system.
However the best way to go will be certainly regular expressions.

--
cody

[Freeware, Games and Humor]
www.deutronium.de.vu || www.deutronium.tk

Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Jon Perez | last post by:
For a given list: fruits= Is it possible to do wildcard matches like shown below? 1. "man*" in fruits
176
by: Thomas Reichelt | last post by:
Moin, short question: is there any language combining the syntax, flexibility and great programming experience of Python with static typing? Is there a project to add static typing to Python? ...
5
by: Thomas Rademacher | last post by:
Hello, I want to collect with the wildcard '*' all existing directories. For example: /dir/dir/*/dir/*/dir/* or C:\dir\dir\*\dir\*\dir\* How can I resolve this problem? Thanks for your...
5
by: Robert Brown | last post by:
I have researched newsgroups and the web very thoroughly and unsuccessfully for a solution to what I believe is a very common problem. I know it's easy to do wildcard match against data in DB...
1
by: JemPower | last post by:
Hi all, Can someone tell me if it's possible to search through a dataview based on a part-filter. For example, if I use... Dim dvAvailable = New DataView(dsRecipients.Tables("Available"),...
78
by: wkehowski | last post by:
The python code below generates a cartesian product subject to any logical combination of wildcard exclusions. For example, suppose I want to generate a cartesian product S^n, n>=3, of that...
3
by: wkehowski | last post by:
The python code below is adapted from a Haskell program written by Tomasz Wielonka on the comp.lang.functional group. It's more verbose than his since I wanted to make sure I got it right. ...
11
by: google | last post by:
I need a simple wildcard pattern matching function written in JS. I have wrestled with regular expresions but frankly am struggling to come up with anything less than an epic function of many lines...
4
by: Raman | last post by:
Hi All, Could any one give any clue about the strcmp function for any supportr of wildcards. or any other standard C Library function ? Regards, Raman Chalotra
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.