I would like to split a String into an array using delimiters and keep those delimiters. I tried using IFS but it re,oves the delimiters.
For example:
ligne="this.is/just(an]example"
IFS='}|//|)|(| |{|[|]|.|;|/"|,' read -ra ADDR <<< "$ligne"
for i in "${ADDR[@]}"; do
echo $i
done
I want the result to be like this:
this
.
is
/
just
(
an
]
example
Thanks for your help!