Answer the question
In order to leave comments, you need to log in
How to substitute "-" every 4 characters?
I need the string [a-zA-Z0-9], for example ABCDEF2GA3BCABCD to be converted to ABCD-EF2G-A3BC-ABCD.
Having messed up the regular expression, I could only get the first 4 separated by a hyphen, and then each character was separated.
I need the string to be split with a hyphen every 4 characters, with a tolerance of [a-zA-Z0-9].
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question