I tried
ELISP> (replace-regexp "war" "negotiation" "trade war")
nil
ELISP>
The results I expect is "trade negotiation"
How could use regex in elisp program?
I think you mistakenly used replace-regex instead of replace-regexp-in-string:
ELISP> (replace-regexp-in-string "war" "negotiation" "trade war")
"trade negotiation"
replace-regexp's third argument is:
Third arg DELIMITED (prefix arg if interactive), if non-nil, means replace only matches surrounded by word boundaries. A negative prefix arg means replace backward.