Before trying to explain my problem, I would like to say that I'm not sure its possible to achieve. I'm a bit confused about the whole idea and wanted to hear your thoughts.
Consider the following paths:
/ax/disks/xyz.prdenv.1/tool_utils/asda/15.2.0.5/asda.csh
/tmp_log/site/disks/sad/tool_utr/zensxi/12.01.001a/log/script.pl
I'm trying to build a script which iterates over a disk which is giving as an input and to try to guess which regex I need for catching the group and the version.
For the first path, I can understand that the group is "asda" and the version is "15.2.0.5" and for the second path I can understand that the group is "zensxi" and the version is 12.01.001a.
So the regex for the first path, could be:
/ax/disks/xyz.prdenv.1/tool_utils/(.*?)/(.*?)/.*
The regex for the second path, could be:
/tmp_log/site/disks/sad/tool_utr(.*?)/(.*?)/.*
Is it possible to achieve? that main problem here, is that the version does not have to be all digits.
The reason I need those regexes is for creating an example file which user can give our tool and it will use those regex to filter the wanted paths.
The script I'm trying to build, will suggest all possible combination of regexes so it the user will just have to look into them and choose the best one.