> For the complete documentation index, see [llms.txt](https://help.impact.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.impact.com/brand/ja/what-would-you-like-to-learn-about/platform-features/promo-codes/regular-expression/regex-outside-the-parentheses.md).

# かっこ外の正規表現

[正規表現](/brand/ja/what-would-you-like-to-learn-about/platform-features/promo-codes/regular-expression/regex-explained.md) (または正規表現)は、アップロードした商品SKU、カテゴリ、またはプロモコードの一部を、コンバージョンとともに impact.com に渡される値に一致させたいときに使用できるコードの一種です。impact.com の Match Expression ツールで正規表現を使用すると、異なる支払いを行いたい商品SKU、カテゴリ、またはプロモコードを識別できます。

#### かっこの外側

配置する正規表現は [かっこの内側に](/brand/ja/what-would-you-like-to-learn-about/platform-features/promo-codes/regular-expression/regex-inside-the-parentheses.md) Match Expression ツールのかっこの中に配置する正規表現は、添付の例外リストで一致させたい値を表します。SKU、カテゴリ、またはプロモコードのリスト項目に対して完全一致以上のことをしたい場合は、かっこの外側に正規表現を追加する必要があります。かっこの外側の演算子は、かっこ内の値と、対応するSKU、カテゴリ、またはプロモコードを持つ受信コンバージョンを一致させます。

#### 例のシナリオ

あなたのブランド、 *ACME Auto*、すべてのタイヤのパートナーへの報酬を減額したいと考えています。 *ACME Auto* タイヤブランドの網羅的なリストはありません。将来カタログに新しいタイヤブランドを追加する予定だからです。ただし、すべてのタイヤSKUは、タイヤブランドを表す3文字に続いて5桁の数字で始まることをご存じでしょう（例： `ABC12345`, `DLY76565`、および `XTX85037`).

すべてのタイヤSKUが3文字に続いて5桁の数字で始まるため、そのSKUパターン用の正規表現を設定し、Match Expression ツールを使って現在のSKU例外リスト内の一致を見つけることができます。将来、 *ACME Auto* 必要に応じて追加の3文字のブランドコードを追加できます。

#### ステップ1: SKUリストを作成する

1. 上部ナビゲーションバーで、 ![](https://1458456015-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwMLlMoFBtKJa8ptd3zaw%2Fuploads%2F210dEQa93qyQgoJDkieL%2FUser%20profile.svg?alt=media\&token=f84c5b17-fae4-4a30-990a-9de5e57a150b) **\[ユーザープロフィール] → 設定**.
2. 右側の、次の下に *例外リスト* セクションで、 **SKU**.
3. 選択 **新しいSKUリストを追加**.
4. リソースの **リスト名**.
5. 各申請者の横にある **イベントタイプ** このSKUリストに関連付けたい

#### ステップ2: 正規表現を設定する

1. 選択 **詳細設定を表示** そして、正規表現を **Match Expression** フィールドに入力します。
   * かっこの内側には、照合したいものを追加します：
     * 正規表現の文字 `\w{3}` を、SKUリスト内の項目の3文字の「テキスト」部分に一致させるために使用します。
   * かっこの外側:
     * 追加 `^` 行の先頭の位置を示すために開きかっこの前に置き、前に文字がないことを保証します。
     * 追加 `\d{5}` 閉じかっこの後ろに置き、3文字のテキストの組み合わせの後に5桁の数字がある場合にのみ、かっこ内の式に一致させます。
     * 最終的な式は次のようになります `^(\w{3})\d{5}`.

       <div data-with-frame="true"><figure><img src="https://1458456015-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwMLlMoFBtKJa8ptd3zaw%2Fuploads%2Fgit-blob-cd8843c09c0dd64c0fa71082298e148a3e57e18d%2F4fde8c68c10a2de3343ef0f40e7c1abca5285c0e8143ae5f2d66db0a2c0e27ea.png?alt=media" alt=""><figcaption></figcaption></figure></div>
2. 選択 **保存して項目を追加**.

#### ステップ3: 例外リスト項目を追加する

1. 照合したい値は、次の2つの方法のいずれかで一覧表示します：
   * **項目を手動で追加** 現在のタイヤブランドSKUをすべて次の欄に入力して *SKU* 欄に入力します。

     <div data-with-frame="true"><figure><img src="https://1458456015-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwMLlMoFBtKJa8ptd3zaw%2Fuploads%2Fgit-blob-6811d8411a2314cf77dd143a143c0426a3e0151f%2Fe808470f9e8dd7f18343707c692918146215c20c064904c4fcf78cf808c94b84.png?alt=media" alt=""><figcaption></figcaption></figure></div>
   * または、 **CSVまたはExcelファイルをアップロード** 現在のタイヤブランドSKUをすべて次の下に一覧表示した *SKU* 列。

     * 参照 [SKU例外リストを作成](/brand/ja/what-would-you-like-to-learn-about/account-administration/program-settings/exception-lists/create-sku-exception-lists.md) 詳細はこちら。

     <div data-with-frame="true"><figure><img src="https://1458456015-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwMLlMoFBtKJa8ptd3zaw%2Fuploads%2FqngJxT1772eJGcigeZMu%2FUntitled%20design%20(30).png?alt=media&amp;token=c030c1ca-d821-43a8-b304-558c6e47ab7d" alt="" width="561"><figcaption></figcaption></figure></div>
2. 新しいタイヤブランドを追加するには、SKUリスト項目を手動またはアップロードで追加するだけです。
   * たとえば、 **BHG123** 3文字のブランドコードが *BHG*.
3. 選択 **保存**.
   * 新しいSKUリストは次の場所に表示されます： *SKUリスト* 画面にアクセスできるようにします。

#### 次は？

正規表現のMatch Expressionを設定し、対応するSKUリスト項目を追加したので、すべての *ACME Auto*のタイヤは、例外リストの一部として照合されます。今後のタイヤブランドも（SKUが3文字に続いて5桁の数字で始まる場合は）必要に応じてSKUリストに追加できます。正規表現に一致する受信コンバージョンは例外リストの一部としてフラグ付けされ、契約ルールがそれに応じて適用されます。

これで、次のルールを追加できます *ACME Auto*のテンプレート条件に、たとえばこれらのSKUが存在するたびに報酬を減額する、などのルールを追加できます。参照 [カテゴリ、SKU、またはプロモコードの例外リストに対する支払いルールの設定](/brand/ja/what-would-you-like-to-learn-about/account-administration/program-settings/exception-lists/set-payout-rules-for-exception-lists.md) 詳細はこちら。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.impact.com/brand/ja/what-would-you-like-to-learn-about/platform-features/promo-codes/regular-expression/regex-outside-the-parentheses.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
