I have a line like this:
msg='123abc456def'
Now I need to split msgand get the result, as shown below:
['123', 'abc', '456', 'def']
In python, I can do the following:
pattern = re.compile(r'(\d+)')
res = pattern.split(msg)[1:]
How to get the same result in a bash script?
I tried like this, but this does not work:
IFS='[0-9]'
echo ${msg[@]}
source
share