NathanE has asked for the wisdom of the Perl Monks concerning the following question:

Hello all; I'm currently working on a project which implements some XML based vulnerability tests into a remote forensics environment which allows the use of Perl to automate functions. Now, my problem is that I can't do a regex match to registry keys (the software doesn't allow it for some reason), but I need to do some simple pattern matching against keys as the XML tests call for it. I've been succesful in doing it in some cases, but without brute forcing through every key in a stupid mannor, I would like to split some of the simpler regex searches into an array to be acted and searched upon. Here's an example of what I'm looking at here;
^SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\Zone +s\\[0-4]$ ^SOFTWARE\\Microsoft\\Fpc\\Arrays\\\{[^\\]+\}\\Extensions\\Proxy-Plugi +ns\\\{FE440D49-AB26-11D2-A101-00C04FB6CFB6\}$
So, basically - I'm just looking to extract an array of all possible combinations given a regex. Any help on this would be greatly appreciated. Thanks agian and take care.

Replies are listed 'Best First'.
Re: Regex into an Array
by davidrw (Prior) on Sep 27, 2005 at 15:09 UTC
    I think that Regexp::Genex might be of interest ... but note that what you're asking is an impossible task, as there are an infinite number of patterns that match /[^\\]+/ since it's a one-or-more match and is unbounded ... (i'm assuming Regexp::Genex has some protection against that)
Re: Regex into an Array
by blazar (Canon) on Sep 27, 2005 at 15:23 UTC
    I'm not completely sure to have understood what your actual problem could really be. But you can cerainly put regexen into an array. The qr// operator is your friend; it returns a blessed reference into a Regex object.
Re: Regex into an Array
by planetscape (Chancellor) on Sep 28, 2005 at 04:51 UTC