---
schema_version: "1"
id: 38c6f8360aca60c1c084e465a61028f023109761c0235b88e80bc69bcaf7a7dd
title: matches
collection: mulesoft
version: current
locale: ja-jp
portal_url: https://docs.salesforce.com/mulesoft/current/ja-jp/dataweave/2.8/dw-core-functions-matches.md
canonical_url: https://docs.mulesoft.com/jp/dataweave/2.8/dw-core-functions-matches
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 2ecc42a61c57e227ca5c53a04248e9436150c029a2a45bb5962f3328d23eaf58
description: MuleSoft Documentation Site
release: "2.8"
latest: false
---
# matches

## [](#matches1)matches(text: String, matcher: Regex): Boolean

式が入力文字列全体に一致するかどうかを確認します。

一致した値を出力するか、条件付きで処理する必要があるユースケースの場合は、 [「DataWeave のパターン一致」](https://docs.mulesoft.com/dataweave/latest/dataweave-pattern-matching)​を参照してください。

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

<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>matcher</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">文字列内の文字を照合する Java 正規表現。</p></td>
</tr>
</tbody>
</table>

### [](#例)例

次の例は、正規表現が入力文字列と一致するかどうかを示します。 `matches(text,matcher)`​ 表記 (​`matches("admin123", /a.*\d+/)`​ など) を使用することも できます。

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

```DataWeave
%dw 2.0
output application/json
---
[ ("admin123" matches /a.*\d+/), ("admin123" matches /^b.+/) ]
```

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

```JSON
[ true, false ]
```

## [](#matches2)matches(text: Null, matcher: Any): false

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

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