---
title: Regex operator -> Regular expression (Regex)
description: "A regular expression is like a smart search — it helps the system find patterns in text, not just exact words. Think of it like telling the system: &quot;Look for anything that looks like this, not just ex"
---

[Skip to content](https://help.ifreturns.com/en/knowledge-center/regex-operator#main-content)

English

Show submenu for translations

[Customer portal](https://help.ifreturns.com/tickets-view?hsLang=en)

![Logo Negativo-4.png\]](https://help.ifreturns.com/hs-fs/hubfs/Logo%20Negativo-4.png?height=40&name=Logo%20Negativo-4.png)

Open main navigation

Close main navigation

- English
  
  Show submenu for translations
- [Customer portal](https://help.ifreturns.com/tickets-view)
- Go to ifreturns.com

 Go to ifreturns.com

 How can we help?

- There are no suggestions because the search field is empty.

1. [Knowledge Center](https://help.ifreturns.com/en/knowledge-center?hsLang=en)
2. [Rules Settings](https://help.ifreturns.com/en/knowledge-center/rules-settings?hsLang=en)
3. [Operators](https://help.ifreturns.com/en/knowledge-center/rules-settings?hsLang=en#operators)

# Regex operator -\> Regular expression (Regex)

#### What Is a Regular Expression?

A **regular expression** is like a smart search — it helps the system **find patterns in text**, not just exact words.

Think of it like telling the system:

> "Look for anything that **looks like this**, not just exactly this."

#### Everyday Analogy:

### Supermarket Example

You tell a store assistant:

> “I want any fruit that **starts with A** and **ends with E**.”

Instead of checking every single word, the assistant understands the **pattern** and brings you:

- Apple
- Artichoke

That’s **what regex does** — it looks for matching patterns, not exact words.

 

#### Easy Examples

### 1. Find postal codes that start with "23"

![](https://help.ifreturns.com/hs-fs/hubfs/image-png-Jul-01-2025-02-45-34-1998-PM.png?width=688&height=133&name=image-png-Jul-01-2025-02-45-34-1998-PM.png)

**Value:** `^23`

- `^` means “starts with”
- `23` is the number you want

**Matches:**

- `23456` ✅
- `23999` ✅
- `12345` ❌ (doesn’t start with 23)

 

---

### 2. Find postal codes that end with "89"

**Value:** `89$`

- `$` means “ends with”
- `89` is the number you want

**Matches:**

- `4789` ✅
- `2289` ✅
- `8923` ❌ (doesn’t end with 89)

 

---

### 3. Match any number with exactly 5 digits (like a postal code)

![](https://help.ifreturns.com/hs-fs/hubfs/image-png-Jul-01-2025-02-45-09-0993-PM.png?width=688&height=151&name=image-png-Jul-01-2025-02-45-09-0993-PM.png)

 

**Value:** `^\d{5}$`

- `^`  means “starts with”
- `\d` means any digit (0–9)
- `{5}` means exactly 5 digits
- `^` and `$` mean “start and end”

**Matches:**

- `12345` ✅
- `90210` ✅
- `1234` ❌ (only 4 digits)
- `123456` ❌ (too many digits)

 

---

### 4. Match any text that **contains the word “Spain”**

**Value:** `Spain`

**Matches:**

- `Order from Spain` ✅
- `Shipped to Spain via DHL` ✅
- `German order` ❌

✅ This is the **simplest** use — just searching for the word.

 

---

### 5. Match emails

**Value:** `[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-z]{2,}`

![](https://help.ifreturns.com/hs-fs/hubfs/image-png-Jul-01-2025-03-13-52-7617-PM.png?width=688&height=314&name=image-png-Jul-01-2025-03-13-52-7617-PM.png)

#### ✅ Examples that Match the Pattern

| Email | Matches? | Why |
| --- | --- | --- |
| `john.doe@example.com` | ✅ | Standard email with dot in name |
| `test123@sub-domain.co.uk` | ✅ | Includes subdomain and multiple parts |
| `name+tag@company.org` | ✅ | Uses `+` symbol, which is valid |
| `user_01@mail-server.net` | ✅ | Underscore `_` and hyphen `-` are allowed |

 

❌ Examples that Don’t Match

| Email | Matches? | Why Not |
| --- | --- | --- |
| `justtext` | ❌ | Missing `@` and domain |
| `user@.com` | ❌ | Domain is missing before the dot |
| `user@site.c` | ❌ | Domain extension only has 1 letter (needs 2 or more) |
| `@example.com` | ❌ | No username before `@` |

 

---

### Postal Code example: ⬇️

### 1. **Postal codes that start with 23**

 

**Value:** `^23`

#### What it means:

| Symbol | Meaning |
| --- | --- |
| `^` | Start of the value (e.g., beginning of the postal code) |
| `23` | The exact numbers we want at the start |

 

Matches:

- `23000` ✅ (starts with 23)
- `23456` ✅
- `23999` ✅

#### Doesn’t match:

- `12345` ❌ (doesn't start with 23)

 

---

### 2. **Postal codes that end with 89**

 

**Value:** `89$`

#### What it means:

| Symbol | Meaning |
| --- | --- |
| `89` | The exact numbers we want at the end |
| `$` | End of the value (e.g., end of the postal code) |

 

#### Matches:

- `4789` ✅ (ends with 89)
- `9989` ✅

#### Doesn’t match:

- `8912` ❌ (89 is at the start, not the end)
- `12345` ❌

 

---

### 3. **Exactly 5-digit postal codes**

 

**Value:** `^\d{5}$`

#### What it means:

| Symbol | Meaning |
| --- | --- |
| `^` | Start of the value |
| `\d` | A single digit (0–9) |
| `{5}` | Exactly 5 of the thing before it (here: 5 digits) |
| `$` | End of the value |

 

So it checks:  
➤ “Starts with a digit, has exactly 5 digits, and nothing more after that.”

#### Matches:

- `12345` ✅(start with a digit, it has only 5 digits, nothing more after that )
- `90210` ✅

#### Doesn’t match:

- `1234` ❌ (only 4 digits)
- `123456` ❌ (6 digits)
- `12A45` ❌ (contains a letter)

 

---

### 4. **Postal codes that contain "00" anywhere**

 

**Value:** `00`

#### What it means:

| Symbol | Meaning |
| --- | --- |
| `00` | Simply looks for the number sequence “00” anywhere in the value |

 

#### Matches:

- `10023` ✅
- `23001` ✅
- `80000` ✅

#### Doesn’t match:

- `12345` ❌
- `23456` ❌

---

### 5. **Postal codes that start with 2 and end with 6**

 

**Value:** `^2.*6$`

#### What it means:

| Symbol | Meaning |
| --- | --- |
| `^` | Start of the value |
| `2` | Must start with the number 2 |
| `.*` | Any number of characters (digits or letters) in between |
| `6` | Ends with the number 6 |
| `$` | End of the value |

 

> `.*` = Think of it as a “wildcard” — it means "any characters in the middle"

#### Matches:

- `2006` ✅
- `23456` ✅
- `2v9456`✅
- `298456` ✅

#### Doesn’t match:

- `12346` ❌ (starts with 1, not 2)
- `23457` ❌ (ends with 7, not 6)

 

---

### 6. **Postal codes with two values in one field**

**![](https://help.ifreturns.com/hs-fs/hubfs/image-png-Jul-01-2025-03-24-15-4371-PM.png?width=688&height=174&name=image-png-Jul-01-2025-03-24-15-4371-PM.png)**

 

**Value:** `^(?:(06039|06059))$`

This is a **regular expression** used to match **specific postal codes** — in this case, either `06039` or `06059`.

`^` -\>   The beginning of the string. It means the match must start at the very beginning.

`(?:..)` -\> A **non-capturing group**. This groups options **without saving them** for later. Think of it as a simple container.

`06039|06059` -\> Inside the group, the \*\*pipe (\`

`$` -\> The end of the string. It means the match must **end here**, with nothing after.

 

---

### Summary of Common Symbols

| Symbol | Meaning |
| --- | --- |
| `^` | Start of the value (e.g., the beginning of a postal code) |
| `$` | End of the value |
| `.` | Any one character |
| `*` | Zero or more of the previous thing (used with `.` in `.*`) |
| `\d` | A digit (0–9) |
| `{5}` | Exactly 5 of the thing before it |

 

 

 

- [Inquiries or Incidents](https://help.ifreturns.com/en/knowledge-center/inquiries-or-incidents?hsLang=en)
- [Getting Started](https://help.ifreturns.com/en/knowledge-center/getting-started?hsLang=en#main-content)

    - [Portal Overview](https://help.ifreturns.com/en/knowledge-center/getting-started?hsLang=en#portal-overview)
    - [Analytics](https://help.ifreturns.com/en/knowledge-center/getting-started?hsLang=en#analytics)
    - [In app configurations](https://help.ifreturns.com/en/knowledge-center/getting-started?hsLang=en#in-app-configurations)
    - [Return Portal Configurations](https://help.ifreturns.com/en/knowledge-center/getting-started?hsLang=en#return-portal-configurations)
    - [UX/UI Return Portal configurations](https://help.ifreturns.com/en/knowledge-center/getting-started?hsLang=en#ux-ui-return-portal-configurations)
    - [Build your refund policy](https://help.ifreturns.com/en/knowledge-center/getting-started?hsLang=en#build-your-refund-policy)
    - [Customizations](https://help.ifreturns.com/en/knowledge-center/getting-started?hsLang=en#customizations)
    - [Promotions Management](https://help.ifreturns.com/en/knowledge-center/getting-started?hsLang=en#promotions-management)
- [Refund Processes](https://help.ifreturns.com/en/knowledge-center/refund-processes?hsLang=en#main-content)

    - [Overview](https://help.ifreturns.com/en/knowledge-center/refund-processes?hsLang=en#overview)
    - [Refunds Methods](https://help.ifreturns.com/en/knowledge-center/refund-processes?hsLang=en#refunds-methods)
    - [Other configurations](https://help.ifreturns.com/en/knowledge-center/refund-processes?hsLang=en#other-configurations)
- [Returns Management](https://help.ifreturns.com/en/knowledge-center/returns-management?hsLang=en#main-content)

    - [Day to Day Operations](https://help.ifreturns.com/en/knowledge-center/returns-management?hsLang=en#day-to-day-operations)
    - [Return Methods](https://help.ifreturns.com/en/knowledge-center/returns-management?hsLang=en#return-methods)
    - [Return Reasons](https://help.ifreturns.com/en/knowledge-center/returns-management?hsLang=en#return-reasons)
    - [Return Policies](https://help.ifreturns.com/en/knowledge-center/returns-management?hsLang=en#return-policies)
- [Rules Settings](https://help.ifreturns.com/en/knowledge-center/rules-settings?hsLang=en#main-content)

    - [General Information](https://help.ifreturns.com/en/knowledge-center/rules-settings?hsLang=en#general-information)
    - [Actions](https://help.ifreturns.com/en/knowledge-center/rules-settings?hsLang=en#actions)
    - [Conditions](https://help.ifreturns.com/en/knowledge-center/rules-settings?hsLang=en#conditions)
    - [Operators](https://help.ifreturns.com/en/knowledge-center/rules-settings?hsLang=en#operators)
    - [Most Common Rules](https://help.ifreturns.com/en/knowledge-center/rules-settings?hsLang=en#most-common-rules)
- [Shipping Integrations](https://help.ifreturns.com/en/knowledge-center/shipping-integrations?hsLang=en#main-content)

    - [ShippyPro](https://help.ifreturns.com/en/knowledge-center/shipping-integrations?hsLang=en#shippypro)
- [Invoices / Documents](https://help.ifreturns.com/en/knowledge-center/invoices-documents?hsLang=en)
- [Releases Notes](https://help.ifreturns.com/en/knowledge-center/releases-notes?hsLang=en#main-content)

    - [Release Notes 1.1](https://help.ifreturns.com/en/knowledge-center/releases-notes?hsLang=en#release-notes-1-1)
    - [Release Notes 1.2](https://help.ifreturns.com/en/knowledge-center/releases-notes?hsLang=en#release-notes-1-2)
    - [Release Notes 1.3](https://help.ifreturns.com/en/knowledge-center/releases-notes?hsLang=en#release-notes-1-3)
    - [Release Notes 1.4](https://help.ifreturns.com/en/knowledge-center/releases-notes?hsLang=en#release-notes-1-4)
    - [Release Notes 2.0](https://help.ifreturns.com/en/knowledge-center/releases-notes?hsLang=en#release-notes-2-0)
    - [Release Notes 2.1](https://help.ifreturns.com/en/knowledge-center/releases-notes?hsLang=en#release-notes-2-1)
    - [Release Notes 2.2](https://help.ifreturns.com/en/knowledge-center/releases-notes?hsLang=en#release-notes-2-2)
    - [Release Notes 2.3](https://help.ifreturns.com/en/knowledge-center/releases-notes?hsLang=en#release-notes-2-3)
    - [Release Notes 3.0](https://help.ifreturns.com/en/knowledge-center/releases-notes?hsLang=en#release-notes-3-0)
    - [Release Notes 3.1](https://help.ifreturns.com/en/knowledge-center/releases-notes?hsLang=en#release-notes-3-1)
    - [Release Notes 3.2](https://help.ifreturns.com/en/knowledge-center/releases-notes?hsLang=en#release-notes-3-2)
    - [Release Notes 4.2](https://help.ifreturns.com/en/knowledge-center/releases-notes?hsLang=en#release-notes-4-2)
    - [Release Notes 5.0](https://help.ifreturns.com/en/knowledge-center/releases-notes?hsLang=en#release-notes-5-0)
- [Frequently Asked Questions](https://help.ifreturns.com/en/knowledge-center/frequently-asked-questions?hsLang=en)

[![Chill listening crop-3](https://help.ifreturns.com/hs-fs/hubfs/iF%20brand/brand-logo.png?width=33&height=24&name=brand-logo.png "Chill listening crop-3")](https://www.ifreturns.com/)

Knowledge center iF returns

<https://www.linkedin.com/company/ifreturns/> <https://www.instagram.com/ifreturns/>

Copyright © 2026, iF Returns