---
schema_version: "1"
id: 51238c25869161d40ed0619f05c85b434e934013fb7f7b56b9c0571d0d6c63b2
title: replaceAll
collection: mulesoft
version: current
locale: ja-jp
portal_url: https://docs.salesforce.com/mulesoft/current/ja-jp/dataweave/2.7/dw-strings-functions-replaceall.md
canonical_url: https://docs.mulesoft.com/jp/dataweave/2.7/dw-strings-functions-replaceall
source_site: docs.mulesoft.com
content_type: documentation
content_hash: f14a43d44a919c8db0a4e67bdbee32b7c547338baef95fc4946060c09efd9ebf
description: MuleSoft Documentation Site
release: "2.7"
latest: false
---
# replaceAll

## [](#replaceall1)replaceAll(text: String, target: String, replacement: String): String

リテラル検索文字列に一致するすべてのサブ文字列を指定された置換文字列に置き換えます。

置換は、文字列の先頭から末尾に向かって行われます。 たとえば、文字列 ​`"aaa"`​ 内の ​`"aa"`​ を ​`"b"`​ に置き換えた結果は、​`"ab"`​ ではなく ​`"ba"`​ です。

_DataWeave バージョン 2.4.0 で導入されました。_

### [](#パラメーター)パラメーター

<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 25%;">
<col style="width: 75%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">名前</th>
<th class="tableblock halign-left valign-top">説明</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>text</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">検索する文字列。</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>target</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>text</code>​ 内で検索して置換する文字列。</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>replacement</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">置換文字列。</p></td>
</tr>
</tbody>
</table>

### [](#例)例

次の例では、さまざまな入力での ​`replaceAll`​ の動作を示します。

#### [](#ソース)ソース

```DataWeave
import * from dw::core::Strings
output application/json
---
{
    a: replaceAll("Mariano", "a" , "A"),
    b: replaceAll("AAAA", "AAA" , "B"),
    c: replaceAll(null, "aria" , "A"),
    d: replaceAll("Mariano", "j" , "Test"),
}
```

#### [](#出力)出力

```Json
{
   "a": "MAriAno",
   "b": "BA",
   "c": null,
   "d": "Mariano"
 }
```

## [](#replaceall2)replaceAll(text: Null, oldValue: String, newValue: String): Null

`replaceAll`​ を ​`null`​ 値に使用できるようにするヘルパー関数。

_DataWeave バージョン 2.4.0 で導入されました。_