I have the following string in php:
$string = 'FEDCBA9876543210';
The string can be have 2 or more (I mean more) hexadecimal characters
I wanted to group string by 2 like :
$output_string = 'FE:DC:BA:98:76:54:32:10';
I wanted to use regex for that, I think I saw a way to do like “recursive regex” but I can’t remember it.
Any help appreciated 🙂
If you don’t need to check the content, there is no use for regex.
Try this
You might need to remove the last “:”.
Or this :
Resources :
On the same topic :