Is it possible for a regex pattern to return all the
2^n combinations of characters of a string as matches?
For example, if the string is
then the regex should return the matches:
a ab ac ad abc abd ... ... (16 matches)
I was trying this regex for the string
But this is only returning 5 matches - Demo
Also, regex patterns like this are dependent on the length of the string to match.
Is there any universal generic pattern which is independent of the input string?