?? [r?ple?ples]
vt. ???; ????... ?? ???? ??; (...) ???
3?? ??: ?? ?? ??: ?? ?? ??: ??
?????? ??() ??? ???
??: ? ???? ?? ??? ?? ??? ???? ???? ???? ?? ???? ??? ? ?????.
??: ??stringObject.replace(regexp/substr,replacement)
????: regexp/substr ?????. ??? ?? ????? ??? ???? RegExp ?????. ?? ???? ?? ?? RegExp ??? ???? ?? ??? ??? ???? ?????. ??? ?????. ??? ?. ???? ???? ?? ???? ???? ??? ?????.?
??: ???? ? ?? ?? ?? ?? ?? ?? ??? ?? ???? ???? ?? ? ??????.
??: ??? ??? replacement() ???? ?? ? ??? ??? ?????. ???? ???? stringObject? ?? ???? ?? ?? ?? ?? ???? ?? ???? ????. ???? ?? ??? g? ?? ??, replacement() ???? ???? ?? ?? ???? ????. ??? ??? ???? ? ?? ?? ???? ????. ??? ?????? ??? ? ????. ???? ?? ? ?? ??? ???? ?????. ??? ???? $ ???? ??? ??? ????. ?? ?? ?? ?? ??? ?? ?? ???? ??? ???? ??? ?????.
??: ECMAScript v3??? replacement() ???? ???? ??? ???? ?? ??? ? ??? ?????. ? ?? ???? ???? ??? ???? ???? ???? ?? ???? ?????. ? ??? ? ?? ????? ??? ???? ??????. ?? ??? ??? ?? ???? ???? ????? ??? ??? 0? ?? ?? ? ????. ?? ????? ??? ???? stringObject? ??? ?????? ?????. ??? ????? stringObject ?????.
?????? ??() ??? ?
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> </head> <body> <script type="text/javascript"> var str="Visit Microsoft!" document.write(str.replace(/Microsoft/, "php.cn")) </script> </body> </html>
???? ?? ?
??? ????? ??? "???? ??" ??? ?????