I'd like to split a string such as
"[1-5]?3456[2-5][4-D]"
to
array[0] = "[1-5]"
array[1] = "?"
array[2] = "3"
array[3] = "4"
array[4] = "5"
array[5] = "6"
array[6] = "[2-5]"
array[7] = "[4-D]"
Can anybody tell me if that's possible with a regex that splits?
I got three elements "3" a letter (which can be 1-9 and A-F, "?" a whitecard, "[1-5]" a range (same 1-9 + A-F)
Edit: Examples that match are
"[1-5]?3456[2-5][4-D]"
"?4A9[1-F]?[A-D]1"
"12459987"
"[1-F][1-F][1-F][1-F][1-F][1-F][1-F][1-F]"