allow="127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1" />
allow="^.\*$" />
sed -i 's/\x31\x32\x37\x5c\x2e\x5c\x64\x2b\x5c\x2e\x5c\x64\x2b\x5c\x2e\x5c\x64\x2b\x7c\x3a\x3a\x31\x7c\x30\x3a\x30\x3a\x30\x3a\x30\x3a\x30\x3a\x30\x3a\x30\x3a\x31/\x5e\x2e\x5c\x2a\x24/g'
[guest@localhost ~]$ s='hello allow="127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1" /> hello'
[guest@localhost ~]$
[guest@localhost ~]$ src='allow="127\\\.\\d+\\\.\\d+\\\.\\d+|::1|0:0:0:0:0:0:0:1" />'
[guest@localhost ~]$ dst='allow="^.\\*$" />'
[guest@localhost ~]$
[guest@localhost ~]$ echo "$s"
hello allow="127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1" /> hello
[guest@localhost ~]$
[guest@localhost ~]$ echo "$src"
allow="127\\\.\\d+\\\.\\d+\\\.\\d+|::1|0:0:0:0:0:0:0:1" />
[guest@localhost ~]$
[guest@localhost ~]$ echo "$dst"
allow="^.\\*$" />
[guest@localhost ~]$
[guest@localhost ~]$ echo "$s" | sed "s%$src%$dst%g"
hello allow="^.\*$" /> hello
[guest@localhost ~]$