# Match Crypto Wallet Addresses

The following information is provided on how to properly check the wallet address entered in the withdrawal form. In order to avoid receiving failed withdrawal requests, the merchant should check the wallet format of the selected currency. For example, you specified a Tron wallet address in the field, but the currency you selected for withdrawal is from the BNB chain network.

The following regular expressions are crafted to match **some** commonly used cryptocurrency wallet address types. This page details the Regex components and pattern tests to match Ethereum, Bitcoin, Dash, Tron, Dogecoin, Litecoin  and Solana addresses.

### Regular Expressions

**Ethereum (ETH)**

```
/^0x[a-fA-F0-9]{40}$/g
```

**Bitcoin (BTC)**

```
/^[13][a-km-zA-HJ-NP-Z1-9]{25,34}$/g
```

<pre><code><strong>/^(bc1|[13])[a-zA-HJ-NP-Z0-9]{25,39}$/g
</strong></code></pre>

**Bitcoin Cash (BCH)**

```
/^((bitcoincash:)?(q|p)[a-z0-9]{41})
```

**Dash (DASH)**

```
/X[1-9A-HJ-NP-Za-km-z]{33}$/g
```

**Tron (TRX)**

```
/T[A-Za-z1-9]{33}
```

**Dogecoin (DOGE)**

```
/^D{1}[5-9A-HJ-NP-U]{1}[1-9A-HJ-NP-Za-km-z]{32}$
```

**Litecoin (LTC)**

```
/^([LM3]{1}[a-km-zA-HJ-NP-Z1-9]{26,33}||ltc1[a-z0-9]{39,59})$/g
```

**Ripple (XRP)**

```
/^r[1-9A-HJ-NP-Za-km-z]{25,34}$
```

**Solana (SOL)**

```
/^[1-9A-HJ-NP-Za-km-z]{32,44}$
```

**The Open Network (TON)**

```
/^(EQ|UQ)[A-Za-z0-9_-]{46}$
```

### Regex Components

**Anchors**

<table data-header-hidden><thead><tr><th width="109"></th><th></th></tr></thead><tbody><tr><td>/</td><td><strong>Open</strong>. Indicates the start of a regular expression.</td></tr><tr><td>^</td><td><strong>Beginning</strong>. Matches the beginning of the string, or the beginning of a line if the multiline flag (<strong>m</strong>) is enabled.</td></tr><tr><td>$</td><td><strong>End</strong>. Matches the end of the string, or the end of a line if the multiline flag (<strong>m</strong>) is enabled.</td></tr><tr><td>/</td><td><strong>Close</strong>. Second "<strong>/</strong>" indicates the end of a regular expression and the start of expression flags.</td></tr></tbody></table>

**Quantifiers**

<table data-header-hidden><thead><tr><th width="164"></th><th></th></tr></thead><tbody><tr><td>{40}</td><td>Ethereum (ETH): Match 40 of the preceeding token.</td></tr><tr><td>{25,34}</td><td>Bitcoin (BTC): Match between 25 and 34 of the preceeding token.</td></tr><tr><td>{33}</td><td>Dash (DASH): Match between 33 of the preceeding token.</td></tr><tr><td>{33}</td><td>Tron (TRX): Match between 33 of the preceeding token.</td></tr><tr><td>{32}</td><td>Dogecoin (DOGE): Match between 32 of the preceeding token.</td></tr><tr><td>{39,59}</td><td>Litecoin (LTC): Match between 39 and 59 of the preceeding token.</td></tr><tr><td>{32,44}</td><td>Solana (SOL): Match between 32 and 44 of the preceeding token.</td></tr></tbody></table>

**OR Operator**

<table data-header-hidden><thead><tr><th width="120"></th><th></th></tr></thead><tbody><tr><td>|</td><td>Alternation acts like a boolean OR. Matches the expression before or after the "|".</td></tr></tbody></table>

**Character Classes**

*Ethereum (ETH)*:

<table data-header-hidden><thead><tr><th width="144"></th><th></th></tr></thead><tbody><tr><td>0</td><td><strong>Character</strong>. Matches a "0" character (char code 48).</td></tr><tr><td>x</td><td><strong>Character</strong>. Matches a "x" character (char code 120). Case sensitive.</td></tr><tr><td>[a-fA-F0-9]</td><td><strong>Character Set</strong>. Match any character in the set. <strong>a-f</strong> Range matches a character in the range "a" to "f" (char code 97 to 102). Case sensitive. <strong>A-F</strong> Range matches a character in the range "A" to "F" (char code 65 to 70). Case sensitive. <strong>0-9</strong> matches a character in the range of "0" to "9" (char code 48 to 57). Case sensitive.</td></tr></tbody></table>

*Bitcoin (BTC)*:

<table data-header-hidden><thead><tr><th width="197"></th><th></th></tr></thead><tbody><tr><td>[a-zA-HJ-NP-Z0-9]</td><td><strong>Character set</strong>. Match any character in the set. <strong>a-z</strong> Range matches a character in the range "a" to "z" (char code 97 to 122). Case sensitive. <strong>A-H</strong> Range matches a character in the range "A" to "H" (char code 65 to 72). Case sensitive. <strong>J-N</strong> Range matches a character in the range "J" to "N" (char code 74 to 78). Case sensitive. <strong>P-Z</strong> Range matches a character in the range "P" to "Z" (char code 80 to 90). Case sensitive. <strong>0-9</strong> Range matches a character in the range "0" to "9" (char code 48 to 57). Case sensitive.</td></tr></tbody></table>

*Dash (DASH)*:

<table data-header-hidden><thead><tr><th width="237"></th><th></th></tr></thead><tbody><tr><td>x</td><td><strong>Character</strong>. Matches a "X" character (char code 88). Case sensitive.</td></tr><tr><td>[1-9A-HJ-NP-Za-km-z]</td><td><strong>Character set</strong>. Match many character in the set. <strong>1-9</strong> Range matches a character in the range "1" to "9" (char code 49 to 57) Case sensitive. <strong>A-H</strong> Range matches a character in the range "A" to "H" (char code 65 to 72). <strong>J-N</strong> Range matches a character in the range "J" to "N" (char code 74 to 78). <strong>P-Z</strong> Range matches a character in the range "P" to "Z" (char code 80 to 90). Case sensitive. <strong>a-k</strong> Range matches a character in the range "a" to "k" (char code 97 to 107). Case sensitive. <strong>m-z</strong> Range matches a character in the range "m" to "z" (char code 109 to 122). Case sensitive.</td></tr></tbody></table>

*Tron (TRX)*:

<table data-header-hidden><thead><tr><th width="237"></th><th></th></tr></thead><tbody><tr><td>T</td><td><strong>Character</strong>. Matches the character "T". Case sensitive.</td></tr><tr><td>[A-Za-z1-9]</td><td><strong>Character set</strong>. Matches any uppercase letter, lowercase letter, or digit. Case sensitive.</td></tr></tbody></table>

*Dogecoin (DOGE)*:

<table data-header-hidden><thead><tr><th width="237"></th><th></th></tr></thead><tbody><tr><td>D{1}</td><td><strong>Character</strong>. Matches a single character that must be "D". Case sensitive.</td></tr><tr><td>[5-9A-HJ-NP-U]{1}</td><td><strong>Character set</strong>. Matches a single character that must be either a digit from 5 to 9 or a uppercase letter excluding I, O, and Q. Case sensitive.</td></tr><tr><td>[1-9A-HJ-NP-Za-km-z]{32}</td><td><strong>Character set</strong>. Matches a sequence of 32 characters that must be either an uppercase letter excluding I, O, and Q, a digit, or a lowercase letter excluding 'l' and 'o'. Case sensitive.</td></tr></tbody></table>

*Litecoin (LTC)*:

<table data-header-hidden><thead><tr><th width="237"></th><th></th></tr></thead><tbody><tr><td>[LM3]{1}</td><td><strong>Character</strong>. Matches a single character that must be either L, M, or 3.. Case sensitive.</td></tr><tr><td>[a-km-zA-HJ-NP-Z1-9]{26,33}</td><td><strong>Character set</strong>. Matches a sequence of 26 to 33 characters that must be either a lowercase letter (excluding 'l'), an uppercase letter (excluding 'I' and 'O'), or a digit (excluding '0') but cannot contain 'o'. Case sensitive.</td></tr><tr><td>ltc1</td><td><strong>Character</strong>. Matches the string "ltc1". Case sensitive.</td></tr><tr><td>[a-z0-9]{39,59}</td><td><strong>Character set</strong>. Matches a sequence of 39 to 59 characters that must be either a lowercase letter or a digit. Case sensitive.</td></tr></tbody></table>

*Solana (SOL)*:

<table data-header-hidden><thead><tr><th width="237"></th><th></th></tr></thead><tbody><tr><td>[1-9A-HJ-NP-Za-km-z]</td><td><strong>Character set</strong>. Match many character in the set. <strong>1-9</strong> Range matches a character in the range "1" to "9" (char code 49 to 57) Case sensitive. <strong>A-H</strong> Range matches a character in the range "A" to "H" (char code 65 to 72). <strong>J-N</strong> Range matches a character in the range "J" to "N" (char code 74 to 78). <strong>P-Z</strong> Range matches a character in the range "P" to "Z" (char code 80 to 90). Case sensitive. <strong>a-k</strong> Range matches a character in the range "a" to "k" (char code 97 to 107). Case sensitive. <strong>m-z</strong> Range matches a character in the range "m" to "z" (char code 109 to 122). Case sensitive.</td></tr></tbody></table>

**Flags**

<table data-header-hidden><thead><tr><th width="107"></th><th></th></tr></thead><tbody><tr><td>g</td><td><strong>Global search</strong>. Retain the index of the last match, allowing subsequent searches to start from the end of the previous match. Without the global flag, subsequent searches will return the same match.</td></tr></tbody></table>

**Grouping and Capturing**

<table data-header-hidden><thead><tr><th width="128"></th><th></th></tr></thead><tbody><tr><td>(bc1|[13])</td><td>Bitcoin (BTC): <strong>Capturing Group</strong>. Groups multiple tokens together and creates a capture group for extracting a substring or using a backreference. <strong>b</strong> Character matches a "b" character (char code 98). Case sensitive. <strong>c</strong> Character matches a "c" character (char code 99). Case sensitive. <strong>1</strong> Character matches a "1" character (char code 49). <strong>|</strong> Alternation acts like a boolean OR. Matches the expression before or after the "|". <strong>Character set</strong> Matches any character in the set; <strong>1</strong> character matches a "1" character (char code 49), <strong>3</strong> character matches a "3" character (char code 51).</td></tr></tbody></table>


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.0xprocessing.com/quick-start/match-crypto-wallet-addresses.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
