如何从正则表达式生成字符串数组?

Few days ago, I posted the same question on Python. Then, just curious, how can I do the same thing on Go?


I'm making a crawler. I'm wanting to take a user's given regex as an input and generate a list of strings to download data.

User's regex sample is:

http://xxx/abc[x-z]/image(9|10|11)\.png

I want to download these.

http://xxx/abcx/image9.png
http://xxx/abcy/image9.png
http://xxx/abcz/image9.png
http://xxx/abcx/image10.png
http://xxx/abcy/image10.png
http://xxx/abcz/image10.png
http://xxx/abcx/image11.png
http://xxx/abcy/image11.png
http://xxx/abcz/image11.png

Can I generate the array from regex strings? Or, can I use each string in for block?

python - Can I create list from regular expressions? - Stack Overflow Can I create list from regular expressions?