(71B) Wildcard pattern matching, directory listing
|
04-16-2021, 07:35 PM
Post: #2
|
|||
|
|||
RE: (71B) Wildcard pattern matching, directory listing
(04-16-2021 02:49 PM)Dave Britten Wrote: The algorithm is relatively simple. It compares the input string to the pattern one character at a time. A ? in the pattern is automatically considered a match against the current character. If * is encountered, it moves the pointer in the pattern to the next character, and starts recursively calling the matching function (FNM), incrementing the pointer to the input string one character at a time until it either finds a match or gives up. Recursion is not needed and can result in exponential blow-up of the matching time. For details see my Code Project post why blow-up happens and how to optimize to match * and ? wildcards and [a-z] ranges efficiently. Hope this helps! - Rob "I count on old friends to remain rational" |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
(71B) Wildcard pattern matching, directory listing - Dave Britten - 04-16-2021, 02:49 PM
RE: (71B) Wildcard pattern matching, directory listing - robve - 04-16-2021 07:35 PM
RE: (71B) Wildcard pattern matching, directory listing - Dave Britten - 04-16-2021, 10:14 PM
RE: (71B) Wildcard pattern matching, directory listing - rprosperi - 04-17-2021, 01:55 AM
RE: (71B) Wildcard pattern matching, directory listing - Dave Britten - 04-17-2021, 03:42 AM
|
User(s) browsing this thread: 3 Guest(s)