Your regex will receive a string of the form
!XX!
#<extra>
where X
is any hexadecimal digit (0-9 and A-F capital letters only), and <extra>
is a character sequence to your choosing. (perhaps something like 0123456789ABCDEF0
could be useful?)
You may use any regex flavour.
Scoring will be calculated as: find regex length + replace length + custom string length. lowest score wins.
Your submission must include which flavour you are using, the find regex, the replace string, and your extra string, all of their lengths, and the total length.
test cases:
!00!
#<extra>
Expected output:
!01!
#<extra>
!AC!
#<extra>
Expected output:
!AD!
#<extra>
!2F!
#<extra>
Expected output:
!30!
#<extra>
!FF!
#<extra>
Expected output:
!00!
#<extra>