{"json_modified": "2015-11-24T07:03:34.580346", "slug": "Web/JavaScript/Reference/Global_Objects/String/replace", "tags": ["\u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f", "String", "Reference", "R\u00e9f\u00e9rence", "Prototype", "JavaScript", "Method"], "locale": "ru", "title": "String.prototype.replace()", "translations": [{"title": "String.prototype.replace()", "url": "/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/String/replace", "tags": ["String", "prototype", "Prototype", "Regular Expressions", "JavaScript", "Method"], "summary": "replace() \u65b9\u6cd5\u4f7f\u7528\u4e00\u4e2a\u66ff\u6362\u503c\uff08replacement\uff09\u66ff\u6362\u6389\u4e00\u4e2a\u5339\u914d\u6a21\u5f0f\uff08pattern\uff09\u5728\u539f\u5b57\u7b26\u4e32\u4e2d\u67d0\u4e9b\u6216\u6240\u6709\u7684\u5339\u914d\u9879\uff0c\u5e76\u8fd4\u56de\u66ff\u6362\u540e\u7684\u5b57\u7b26\u4e32\u3002\u8fd9\u4e2a\u66ff\u6362\u6a21\u5f0f\u53ef\u4ee5\u662f\u5b57\u7b26\u4e32\u6216\u8005RegExp
\uff08\u6b63\u5219\u8868\u8fbe\u5f0f\uff09\uff0c\u66ff\u6362\u503c\u53ef\u4ee5\u662f\u4e00\u4e2a\u5b57\u7b26\u4e32\u6216\u8005\u4e00\u4e2a\u51fd\u6570\u3002", "localization_tags": [], "locale": "zh-CN", "last_edit": "2015-11-07T00:11:32", "review_tags": []}, {"title": "String.prototype.replace()", "url": "/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace", "tags": ["Regular", "String", "Expressions", "Reference", "Prototype", "JavaScript", "Method"], "summary": "The replace()
method returns a new string with some or all matches of a pattern
replaced by a replacement
. The pattern
can be a string or a RegExp
, and the replacement
can be a string or a function to be called for each match.", "localization_tags": [], "locale": "en-US", "last_edit": "2015-10-17T03:04:13", "review_tags": []}, {"title": "String.prototype.replace()", "url": "/ja/docs/Web/JavaScript/Reference/Global_Objects/String/replace", "tags": ["Regular", "Methods", "String", "Expressions", "JavaScript"], "summary": "replace()
\u30e1\u30bd\u30c3\u30c9\u306f\u3001pattern
\u306b\u30de\u30c3\u30c1\u3057\u305f\u6587\u5b57\u5217\u306e\u4e00\u90e8\u307e\u305f\u306f\u5168\u3066\u3092 replacement
\u3067\u7f6e\u304d\u63db\u3048\u305f\u65b0\u3057\u3044\u6587\u5b57\u5217\u3092\u8fd4\u3057\u307e\u3059\u3002pattern
\u306f\u6587\u5b57\u5217\u307e\u305f\u306f RegExp
\u3001replacement
\u306f\u6587\u5b57\u5217\u307e\u305f\u306f\u5404\u30de\u30c3\u30c1\u3067\u547c\u3073\u51fa\u3055\u308c\u308b\u95a2\u6570\u3067\u3059\u3002", "localization_tags": [], "locale": "ja", "last_edit": "2015-10-17T03:05:00", "review_tags": []}, {"title": "String.prototype.replace()", "url": "/es/docs/Web/JavaScript/Referencia/Objetos_globales/String/replace", "tags": ["String", "Prototype", "Regular Expressions", "JavaScript", "Method"], "summary": "El replace()
m\u00e9todo halla un emparejamiento entre una expresi\u00f3n regular y una cadena, y reemplaza la subcadena emparejada con una nueva subcadena.", "localization_tags": [], "locale": "es", "last_edit": "2015-08-03T07:57:28", "review_tags": []}, {"title": "String.prototype.replace()", "url": "/fr/docs/Web/JavaScript/Reference/Objets_globaux/String/replace", "tags": ["Regular", "String", "Expressions", "Reference", "R\u00e9f\u00e9rence", "Prototype", "JavaScript", "Method"], "summary": "La m\u00e9thode replace()
renvoie une nouvelle cha\u00eene de caract\u00e8res dans laquelle certaines correspondances ou toutes les correspondances par rapport \u00e0 un motif
sont remplac\u00e9es par un texte de remplacement
. Le motif utilis\u00e9 peut \u00eatre une RegExp
et le param\u00e8tre de remplacement peut \u00eatre une cha\u00eene ou une fonction \u00e0 appeler sur chaque correspondance.", "localization_tags": [], "locale": "fr", "last_edit": "2015-10-17T10:01:18", "review_tags": []}, {"title": "String.prototype.replace()", "url": "/zh-TW/docs/Web/JavaScript/Reference/Global_Objects/String/replace", "tags": [], "summary": "replace(pattern, replacement)
\u65b9\u6cd5\u50b3\u56de\u4e00\u500b\u65b0\u5b57\u4e32\uff0c\u6b64\u65b0\u5b57\u4e32\u662f\u900f\u904e\u5c07\u539f\u5b57\u4e32\u8207 pattern
\u6bd4\u5c0d\uff0c\u7528 replacement
\u53d6\u4ee3\u543b\u5408\u8655\u800c\u751f\u6210\u3002 pattern
\u53ef\u4ee5\u662f\u5b57\u4e32\u6216\u6216 RegExp, replacement
\u53ef\u4ee5\u662f\u5b57\u4e32\u6216\u51fd\u5f0f\u3002", "localization_tags": [], "locale": "zh-TW", "last_edit": "2014-07-04T07:14:13", "review_tags": []}, {"title": "String.prototype.replace()", "url": "/de/docs/Web/JavaScript/Reference/Global_Objects/String/replace", "tags": ["Regul\u00e4re Ausdr\u00fccke", "String", "prototype", "Prototype", "JavaScript", "Method"], "summary": "Die replace()
-Methode gibt eine neue Zeichenkette zur\u00fcck, in der einige oder alle \u00dcbereinstimmungen mit einem Muster durch einen Ersatz
ausgetauscht wurden. Das Muster
kann eine Zeichenkette oder eine RegExp sein, als Ersatz
dienen eine Zeichenkette oder eine Funktion, welche f\u00fcr jede \u00dcbereinstimmung aufgerufen wird.", "localization_tags": ["inprogress"], "locale": "de", "last_edit": "2015-11-19T02:00:20", "review_tags": []}, {"title": "String.prototype.replace()", "url": "/pt-BR/docs/Web/JavaScript/Reference/Global_Objects/String/replace", "tags": [], "summary": "O m\u00e9todo replace()
retorna uma nova string com algum ou todas as combina\u00e7\u00f5es do padr\u00e3o substitu\u00eddo por um substituto. O padr\u00e3o pode ser uma string ou uma RegExp
, e o substituto pode ser uma string ou uma fun\u00e7\u00e3o a ser chamada por cada combina\u00e7\u00e3o.", "localization_tags": ["inprogress"], "locale": "pt-BR", "last_edit": "2015-05-29T14:13:22", "review_tags": []}], "modified": "2015-11-24T07:03:32", "label": "String.prototype.replace()", "localization_tags": [], "url": "/ru/docs/Web/JavaScript/Reference/Global_Objects/String/replace", "last_edit": "2015-02-02T05:09:02", "summary": "\u041c\u0435\u0442\u043e\u0434 replace()
\u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043d\u043e\u0432\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u0441 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0438\u043b\u0438 \u0432\u0441\u0435\u043c\u0438 \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f\u043c\u0438 \u0441 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u043c, \u0437\u0430\u043c\u0435\u043d\u0451\u043d\u043d\u044b\u043c\u0438 \u043d\u0430 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u0435\u043b\u044c. \u0428\u0430\u0431\u043b\u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u043e\u0439 \u0438\u043b\u0438 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u043c \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435\u043c, \u0430 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u0435\u043b\u044c \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u043e\u0439 \u0438\u043b\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439, \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c\u043e\u0439 \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0438.", "sections": [{"id": "Quick_Links", "title": null}, {"id": "Summary", "title": "\u0421\u0432\u043e\u0434\u043a\u0430"}, {"id": "Syntax", "title": "\u0421\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441"}, {"id": "Parameters", "title": "\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b"}, {"id": "Returns", "title": "\u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435"}, {"id": "Description", "title": "\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435"}, {"id": "Specifying_a_string_as_a_parameter", "title": "\u041f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u0441\u0442\u0440\u043e\u043a\u0438 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430"}, {"id": "Specifying_a_function_as_a_parameter", "title": "\u041f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430"}, {"id": "Examples", "title": "\u041f\u0440\u0438\u043c\u0435\u0440\u044b"}, {"id": "Example:_Using_global_and_ignore_with_replace", "title": "\u041f\u0440\u0438\u043c\u0435\u0440: \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0444\u043b\u0430\u0433\u043e\u0432 "}, {"id": "Example:_Defining_the_regular_expression_in_replace", "title": "\u041f\u0440\u0438\u043c\u0435\u0440: \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e\u0433\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0432 \u043c\u0435\u0442\u043e\u0434 "}, {"id": "Example:_Switching_words_in_a_string", "title": "\u041f\u0440\u0438\u043c\u0435\u0440: \u0441\u043c\u0435\u043d\u0430 \u043c\u0435\u0441\u0442\u0430\u043c\u0438 \u0441\u043b\u043e\u0432 \u0432 \u0441\u0442\u0440\u043e\u043a\u0435"}, {"id": "Example:_Using_an_inline_function_that_modifies_the_matched_characters", "title": "\u041f\u0440\u0438\u043c\u0435\u0440: \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0432\u0448\u0438\u0445\u0441\u044f \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432"}, {"id": "Example:_Replacing_a_Fahrenheit_degree_with_its_Celsius_equivalent", "title": "\u041f\u0440\u0438\u043c\u0435\u0440: \u0437\u0430\u043c\u0435\u043d\u0430 \u0433\u0440\u0430\u0434\u0443\u0441\u043e\u0432 \u043f\u043e \u0424\u0430\u0440\u0435\u043d\u0433\u0435\u0439\u0442\u0443 \u043d\u0430 \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442 \u0432 \u0433\u0440\u0430\u0434\u0443\u0441\u0430\u0445 \u043f\u043e \u0426\u0435\u043b\u044c\u0441\u0438\u044e"}, {"id": "Example: Use an inline function with a regular expression to avoid for loops", "title": "\u041f\u0440\u0438\u043c\u0435\u0440: \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u043c \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435\u043c \u0434\u043b\u044f \u0438\u0437\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043e\u0442 \u0446\u0438\u043a\u043b\u0430 "}, {"id": "Specifications", "title": "\u0421\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438"}, {"id": "Browser_compatibility", "title": "\u0421\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u044c \u0441 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430\u043c\u0438"}, {"id": "Firefox-specific_notes", "title": "\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u044f \u043f\u043e Firefox"}, {"id": "See_also", "title": "\u0421\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u0442\u0430\u043a\u0436\u0435"}], "id": 80043, "review_tags": []}