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

## [](#with1)with(((V, U) -> R) -> X, (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" }
```