Regex Replacement
Introduce how to use regex to replace text.
Manual
Get details from capture-groups-and-replacement-patterns.
Example
Replace from (?! )([\w -]+ )%"PRIu64" packet%s to %"PRIu64" $1 packet%s
Before replacement
dump("Transmit %"PRIu64" packet%s, %"PRIu64" byte%s\n"
"%"PRIu64" unicast packet%s, %"PRIu64" multicast packet%s, "
"broadcast %"PRIu64" packet%s\n"
"good multicast %"PRIu64" packet%s, good broadcast %"PRIu64" packet%s\n"
"64B %"PRIu64" packet%s, 65-127B %"PRIu64" packet%s\n"
"128-255B %"PRIu64" packet%s, 256-511B %"PRIu64" packet%s\n"
"512-1023B %"PRIu64" packet%s, 1024B- %"PRIu64" packet%s\n",
After replacement
dump("%"PRIu64" Transmit packet%s, %"PRIu64" byte%s\n"
"%"PRIu64" unicast packet%s, %"PRIu64" multicast packet%s, "
"%"PRIu64" broadcast packet%s\n"
"%"PRIu64" good multicast packet%s, %"PRIu64" good broadcast packet%s\n"
"%"PRIu64" 64B packet%s, %"PRIu64" 65-127B packet%s\n"
"%"PRIu64" 128-255B packet%s, %"PRIu64" 256-511B packet%s\n"
"%"PRIu64" 512-1023B packet%s, %"PRIu64" 1024B- packet%s\n",