---
schema_version: "1"
id: e0136fb0e798a6fef92e504e8279d85c9ad5d3c4a9c1ac4e10ab6e755691de34
title: with
collection: mulesoft
version: current
locale: ja-jp
portal_url: https://docs.salesforce.com/mulesoft/current/ja-jp/dataweave/2.4/dw-core-functions-with.md
canonical_url: https://docs.mulesoft.com/jp/dataweave/2.4/dw-core-functions-with
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 6dd5a6c8f1dff952cfaa456752aaa49ee51864a8dadb0a913c6ad6393d27d101
description: MuleSoft Documentation Site
release: "2.4"
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" }
```