[Solved] Expand Python regex to list of all possible strings [closed]


You could use Exrex. Install with pip install exrex.

Then execute in terminal:

exrex 'Good (Morning|afternoon|evening) my (friends|family|brothers|sisters)\. hope you like (apple|orange|grape) juice\.'

Make sure not to forget the backslashes \ before the dots ., as dots are a special character inside regexes. This will return:

Good Morning my friends. hope you like apple juice.
Good Morning my friends. hope you like orange juice.
Good Morning my friends. hope you like grape juice.
Good Morning my family. hope you like apple juice.
Good Morning my family. hope you like orange juice.
Good Morning my family. hope you like grape juice.
Good Morning my brothers. hope you like apple juice.
Good Morning my brothers. hope you like orange juice.
Good Morning my brothers. hope you like grape juice.
Good Morning my sisters. hope you like apple juice.
Good Morning my sisters. hope you like orange juice.
Good Morning my sisters. hope you like grape juice.
Good afternoon my friends. hope you like apple juice.
Good afternoon my friends. hope you like orange juice.
Good afternoon my friends. hope you like grape juice.
Good afternoon my family. hope you like apple juice.
Good afternoon my family. hope you like orange juice.
Good afternoon my family. hope you like grape juice.
Good afternoon my brothers. hope you like apple juice.
Good afternoon my brothers. hope you like orange juice.
Good afternoon my brothers. hope you like grape juice.
Good afternoon my sisters. hope you like apple juice.
Good afternoon my sisters. hope you like orange juice.
Good afternoon my sisters. hope you like grape juice.
Good evening my friends. hope you like apple juice.
Good evening my friends. hope you like orange juice.
Good evening my friends. hope you like grape juice.
Good evening my family. hope you like apple juice.
Good evening my family. hope you like orange juice.
Good evening my family. hope you like grape juice.
Good evening my brothers. hope you like apple juice.
Good evening my brothers. hope you like orange juice.
Good evening my brothers. hope you like grape juice.
Good evening my sisters. hope you like apple juice.
Good evening my sisters. hope you like orange juice.
Good evening my sisters. hope you like grape juice.

solved Expand Python regex to list of all possible strings [closed]