Sample Header Ad - 728x90

Regex pattern in sed to match hexadecimal address of fixed length

0 votes
1 answer
278 views
I would like to match a hexadecimal address of fixed length using a regex pattern in sed. For example: 0x000000010b2e993c 0x is always present followed by the sixteen-character hexadecimal number. This is successful: 's/0x[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]//' Is there a shorthand way to match whereby I can use 0x then [0-9a-f] occurring sixteen times?
Asked by Max MacLeod (103 rep)
Apr 29, 2024, 02:58 PM
Last activity: Apr 30, 2024, 08:03 AM