那个函数则接收匹配到的数组作为参数,然后返回一个修改后的字符串作为替换。
This function receives the match array as a parameter and returns a modified string that is used as a replacement.
此函数在字符串中搜索给定模式并用新的值替换它们。
This function searches for given patterns in a string and replaces them with a new value.
replace函数采用了三个参数:第一个参数是要修改的文本,第二个参数是与将要替换的部分匹配的正则表达式,第三个参数是替换字符串。
The replace function USES three arguments: the first is the text to modify, the second is the regular expression that matches the part to be replaced, and the third is the replacement string.
应用推荐