Generate all Permutations of text from a regex pattern in C#

后端 未结 3 667
Happy的楠姐
Happy的楠姐 2021-01-17 06:23

So i have a regex pattern, and I want to generate all the text permutations that would be allowed from that pattern.

Example:

var pattern = \"^My (?:         


        
3条回答
  •  无人及你
    2021-01-17 07:00

    One method that might be a bit weird would be to put the possible choices into an array first, and then generate the regex based on the array and then use the same array to generate the permutations.

提交回复
热议问题