How can regularities be replaced in batches according to the mapping relationship?

such as

var map = {
    a: 1,
    b :2,
    c :3
}
As a matter of fact, there is no map object for

. I hope this map is a regular expression. How to write to realize the change from "abc" to 123" and how to find this regular expression with replace

?
Mar.07,2021

is roughly as follows:
'abcdabcdeabceee'.replace (/ abc/g,' 123')
/ / 123d123de123eee
I don't know what your mapping relationship is?

Menu