---
schema_version: "1"
id: 0a58aa33048f510eaf54bb1865112d4b7a6bab27249f8646f34fa0bc5a799d4a
title: with
collection: mulesoft
version: current
locale: ja-jp
portal_url: https://docs.salesforce.com/mulesoft/current/ja-jp/dataweave/2.7/dw-core-functions-with.md
canonical_url: https://docs.mulesoft.com/jp/dataweave/2.7/dw-core-functions-with
source_site: docs.mulesoft.com
content_type: documentation
content_hash: f0873b80baf8acd28c52db284ba31deb5d219915b3fefa2c26afedeb1e1dee2d
description: MuleSoft Documentation Site
release: "2.7"
latest: false
---
# with

## [](#with1)with<V, U, R, X>(toBeReplaced: ((V, U) -> R) -> X, replacer: (V, U) -> R): X

置換要素を指定するヘルパー関数。この関数は、​`replace`​、​`update`​、または ​`mask`​ と共に使用してデータ置換を実行します。

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

<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>toBeReplaced</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>replacer</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">入力値を置換する値。</p></td>
</tr>
</tbody>
</table>

### [](#例)例

次の例では、文字列内のすべての数字を文字「x」に置換します。​`replace`​ 関数ではベース文字列、および置換する文字を選択する正規表現を指定し、​`with`​ では使用する置換文字列を指定します。

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

```DataWeave
%dw 2.0
output application/json
---
{ "ssn" : "987-65-4321" replace /[0-9]/ with("x") }
```

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

```JSON
{ "ssn": "xxx-xx-xxxx" }
```