I need to breakdown a string into an array or list of character sets based on the set beeing alphabet characters and non-alphabet characters.
For example:
string = -"Hello12$th'ere!@4"
the required result = [-"][Hello][12$][th]['][ere][!@4]
Does anyone have an idea of how to get to the required result? I was trying to achieve this by searching for a regex.split solution, but I can't find an expression that suits my needs.
This simple regex does the trick: ([a-zA-Z]+|[^a-zA-Z]+)
Test it out here.