Tan Phat Digital

Regex Collection Online Free

20 common regular expressions — copy, test, and use instantly

Email Address

Validation
^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$

Example: user@example.com

URL (http/https)

Validation
https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&/=]*)

Example: https://example.com/path

Phone (US)

Validation
^(\+1)?[-.\s]?\(?[0-9]{3}\)?[-.\s]?[0-9]{3}[-.\s]?[0-9]{4}$

Example: (555) 123-4567

IPv4 Address

Network
^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$

Example: 192.168.1.1

Date (YYYY-MM-DD)

Date/Time
^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$

Example: 2024-01-15

Time (HH:MM)

Date/Time
^([01]?[0-9]|2[0-3]):[0-5][0-9]$

Example: 14:30

Hex Color

Design
^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$

Example: #FF5733

Strong Password

Security
^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$

Example: P@ssw0rd!

Credit Card

Finance
^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11})$

Example: 4111111111111111

ZIP Code (US)

Validation
^\d{5}(-\d{4})?$

Example: 12345 or 12345-6789

Username (alphanumeric)

Validation
^[a-zA-Z0-9_]{3,20}$

Example: user_name123

Slug (URL-friendly)

Web
^[a-z0-9]+(?:-[a-z0-9]+)*$

Example: my-blog-post

HTML Tag

Web
<([a-z][a-z0-9]*)\b[^>]*>(.*?)<\/\1>

Example: <div class='test'>content</div>

JWT Token

Security
^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$

Example: eyJ...header.payload.signature

Semantic Version

Developer
^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?$

Example: 1.2.3 or 2.0.0-beta.1

MAC Address

Network
^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$

Example: 00:1A:2B:3C:4D:5E

Positive Integer

Numbers
^[1-9]\d*$

Example: 42

Decimal Number

Numbers
^-?\d+(\.\d+)?$

Example: -3.14

YouTube URL

Web
^(https?:\/\/)?(www\.)?(youtube\.com\/watch\?v=|youtu\.be\/)([\w-]{11})

Example: https://youtube.com/watch?v=dQw4w9WgXcQ

Base64 String

Developer
^[A-Za-z0-9+/]*={0,2}$

Example: SGVsbG8gV29ybGQ=

Regex Collection Online Free - Common Regular Expressions Library

Browse 20 common regular expressions online free. Copy patterns for email, URL, phone, password, IP address, date, hex color, credit card, JWT, semantic versioning, MAC address, slug, and more. Test each pattern against your own input with instant match or no-match feedback. Filter by category or search by name. Useful for developers who need quick regex examples, validation starting points, and learning references before adapting patterns to a specific project.

Key Features

20 common regex patterns
Filter by category (Validation, Security, Network, etc.)
Search patterns by name
Test patterns with custom input
Instant match/no-match feedback
Copy pattern with one click
Pattern description and example
Works with JavaScript regex syntax
Free, no registration required

Why Use a Regex Collection?

Writing regex from scratch is time-consuming and easy to get wrong. A single misplaced character can cause false positives, false negatives, or brittle validation logic. This collection provides practical starting points for common validation and parsing tasks. Each pattern should still be reviewed against your own requirements, locale rules, allowed edge cases, and security needs before being used in production.

Benefits

  • Save time writing regex from scratch
  • Use practical starting points for common patterns
  • Test patterns against your own input instantly
  • Learn regex by studying real-world examples
  • Reduce common validation mistakes before deeper review
  • Copy and use patterns directly in your code

How to Use the Regex Collection

  1. 1Browse the pattern cards or use the search box
  2. 2Filter by category to find relevant patterns
  3. 3Read the pattern description and example
  4. 4Click the copy button to copy the regex pattern
  5. 5Test the pattern by typing in the test input field
  6. 6See instant match/no-match feedback as you type

How to Use Regex in Different Languages

JavaScript: new RegExp(pattern).test(input) or /pattern/.test(input). Python: import re; re.match(pattern, input). PHP: preg_match('/pattern/', input). Java: Pattern.compile(pattern).matcher(input).matches(). C#: Regex.IsMatch(input, pattern). Most patterns in this collection use standard regex syntax compatible with all these languages. Some patterns may need minor adjustments for language-specific syntax.

Regex Validation Limits

Regex can validate shape, but it cannot always prove real-world truth. An email pattern can check format but not inbox ownership. A URL pattern can check structure but not whether the page exists. A credit card pattern can match issuer ranges but still needs a Luhn check and payment processor validation. Use regex as one layer in a larger validation workflow.

Testing Patterns Safely

Test every pattern with valid examples, invalid examples, empty strings, long strings, unusual characters, and locale-specific inputs. For user-facing forms, write unit tests around the final pattern and keep error messages helpful. Avoid overly complex patterns that are hard to maintain or may create performance issues with untrusted input.

When to use Regex Collection Online Free

Regex Collection Online Free is useful when you need to complete a focused task quickly without installing desktop software, creating another account, or switching into a heavy workflow. It works well for quick checks, conversions, previews, cleanups, generation tasks, and everyday operations where speed and consistency matter. Browse 20 common regular expressions online free. Copy patterns for email, URL, phone, password, IP address, date, hex color, credit card, JWT, semantic versioning, MAC address, slug, and more. Test each pattern against your own input with instant match or no-match feedback. Filter by category or search by name. Useful for developers who need quick regex examples, validation starting points, and learning references before adapting patterns to a specific project.

Recommended workflow

Start with a small sample so you understand how Regex Collection Online Free handles your input, then apply it to the full task. Review the important fields, copy or export the result, and test it in the place where you plan to use it. This keeps the tool fast while still giving you a practical quality-control step before production use.

Frequently Asked Questions

Are these patterns production-ready?

Treat them as strong starting points, not final policy. Always test with your specific use case, locale, input source, and security requirements before production use.

How do I use a regex in JavaScript?

Use new RegExp(pattern).test(input) or /pattern/.test(input). For example: /^[a-z]+$/.test('hello') returns true.

What does ^ and $ mean in regex?

^ means 'start of string' and $ means 'end of string'. Together they ensure the entire string matches the pattern, not just a part of it.

How do I make a regex case-insensitive?

Add the 'i' flag: new RegExp(pattern, 'i') or /pattern/i. This makes the pattern match both uppercase and lowercase letters.

Can I test my own regex patterns?

Yes, use the test input field below each pattern to test it against your own input. A green 'Match' or red 'No match' indicator shows the result.

Is Regex Collection Online Free free?

Yes. Regex Collection Online Free is designed as a free browser-based utility for quick personal, learning, and professional workflows.

Do I need to install anything?

No. You can use Regex Collection Online Free directly in a modern browser such as Chrome, Edge, Safari, or Firefox.

Does Regex Collection Online Free work on mobile?

Yes. The page is responsive and can be used on phones and tablets, although desktop is usually more comfortable for long input or repeated copy operations.

How do I get more accurate results?

Use clean input, test with a small sample first, review the output carefully, and adjust any details that depend on your final use case.

Can I use the output commercially?

In most cases, yes. You can use the generated or processed output in personal and commercial projects, but legal, financial, medical, or security-sensitive work should still be reviewed by a qualified person.

Is my input stored?

The tool is built for quick browser workflows. You should still avoid entering highly sensitive data unless the specific tool clearly states how the data is handled.

Can I export or copy the result?

Many tools include copy or download actions. If a dedicated export is not available, you can usually copy the visible result manually.

Related Keywords

regex collectioncommon regex patternsregular expression libraryregex examplesregex cheatsheetregex patterns onlinevalidation regexregex reference guideRegex Collection Online Free onlineRegex Collection Online Free freeRegex Collection Online Free no signupRegex Collection Online Free browser toolRegex Collection Online Free for creatorsRegex Collection Online Free for developersRegex Collection Online Free for marketersRegex Collection Online Free workflowRegex Collection Online Free best practicesRegex Collection Online Free guide

Hợp tác ngay với Tấn Phát Digital

Chúng tôi không chỉ thiết kế website, mà còn giúp doanh nghiệp xây dựng thương hiệu số mạnh mẽ. Cung cấp dịch vụ thiết kế website trọn gói từ thiết kế đến tối ưu SEO. Hãy liên hệ ngay với Tấn Phát Digital để cùng tạo nên những giải pháp công nghệ đột phá, hiệu quả và bền vững cho doanh nghiệp của bạn tại Hồ Chí Minh.

Công cụ Developer Tools liên quan

Zalo
Facebook
Tan Phat Digital
Zalo
Facebook