Skip to main content
CheckTown

Regex लाइब्रेरी

श्रेणी के अनुसार व्यवस्थित सामान्य regex पैटर्न देखें

हमारे Regex टेस्टर में अपने पैटर्न आज़माएँ

ईमेल

Simple Email

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

Matches a basic email address format

मेल: user@example.comकोई मेल नहीं: user@.com

Email with Display Name

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

Matches an email with a display name like "John Doe <john@example.com>"

मेल: John Doe <john@example.com>कोई मेल नहीं: john@example.com

Email Domain Extraction

@([a-zA-Z0-9.-]+\.[a-zA-Z]{2,})

Extracts the domain part from an email address

मेल: user@example.comकोई मेल नहीं: no-at-sign-here

No-Reply Email

^no-?reply@

Matches email addresses starting with no-reply or noreply

मेल: no-reply@example.comकोई मेल नहीं: contact@example.com

URL

URL with Protocol

^https?:\/\/[^\s/$.?#].[^\s]*$

Matches a URL starting with http:// or https://

मेल: https://example.com/pathकोई मेल नहीं: ftp://example.com

URL Slug

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

Matches a URL-safe slug with lowercase letters, numbers, and hyphens

मेल: my-blog-postकोई मेल नहीं: My Blog Post

Domain Name

^(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$

Matches a valid domain name like example.com or sub.domain.org

मेल: sub.example.comकोई मेल नहीं: -invalid.com

URL Query Parameter

[?&]([^=]+)=([^&]*)

Extracts key=value pairs from URL query strings

मेल: ?name=John&age=30कोई मेल नहीं: /path/without/params

YouTube Video ID

(?:youtube\.com\/watch\?v=|youtu\.be\/)([a-zA-Z0-9_-]{11})

Extracts the 11-character video ID from YouTube URLs

मेल: https://youtu.be/dQw4w9WgXcQकोई मेल नहीं: https://vimeo.com/12345

तारीख़ और समय

ISO 8601 Date

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

Matches dates in ISO 8601 format (YYYY-MM-DD)

मेल: 2024-12-31कोई मेल नहीं: 31-12-2024

Date (MM/DD/YYYY)

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

Matches dates in US format (MM/DD/YYYY)

मेल: 12/31/2024कोई मेल नहीं: 31/12/2024

Date (DD/MM/YYYY)

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

Matches dates in European format (DD/MM/YYYY)

मेल: 31/12/2024कोई मेल नहीं: 2024-12-31

24-Hour Time

^([01]\d|2[0-3]):([0-5]\d)(?::([0-5]\d))?$

Matches time in 24-hour format with optional seconds

मेल: 23:59:59कोई मेल नहीं: 25:00

12-Hour Time

^(0?[1-9]|1[0-2]):[0-5]\d\s?(?:AM|PM|am|pm)$

Matches time in 12-hour format with AM/PM

मेल: 2:30 PMकोई मेल नहीं: 13:30 PM

संख्या

Integer

^-?\d+$

Matches positive or negative whole numbers

मेल: -42कोई मेल नहीं: 3.14

Decimal Number

^-?\d+\.?\d*$

Matches positive or negative numbers with optional decimal part

मेल: 3.14कोई मेल नहीं: abc

Hex Color

^#(?:[0-9a-fA-F]{3}){1,2}$

Matches 3 or 6 digit hex color codes with # prefix

मेल: #ff6600कोई मेल नहीं: #gggggg

Currency (USD)

^\$\d{1,3}(,\d{3})*(\.\d{2})?$

Matches US dollar amounts with optional cents and thousands separators

मेल: $1,234.56कोई मेल नहीं: 1234.56

Percentage

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

Matches percentage values with optional decimal part

मेल: 99.9%कोई मेल नहीं: 99.9

फ़ोन

International Phone

^\+?[1-9]\d{1,14}$

Matches international phone numbers in E.164 format

मेल: +14155552671कोई मेल नहीं: 0000000

US Phone

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

Matches US phone numbers in various formats

मेल: (415) 555-2671कोई मेल नहीं: 123

Phone with Extension

^(\+?\d{1,3})?[-.\s]?\(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4}(\s*(ext|x|ext.)\s*\d{2,5})?$

Matches phone numbers with optional country code and extension

मेल: +1 415-555-2671 ext 1234कोई मेल नहीं: not-a-phone

Digits Only (Phone)

^\d{10,15}$

Matches phone numbers as digit-only strings (10 to 15 digits)

मेल: 4155552671कोई मेल नहीं: 12345

IP और नेटवर्क

IPv4 Address

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

Matches a valid IPv4 address (0.0.0.0 to 255.255.255.255)

मेल: 192.168.1.1कोई मेल नहीं: 256.1.1.1

IPv4 with Port

^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?):(\d{1,5})$

Matches an IPv4 address followed by a port number

मेल: 192.168.1.1:8080कोई मेल नहीं: 192.168.1.1

IPv6 Address

^(?:[0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}$

Matches a full IPv6 address (8 groups of hex digits)

मेल: 2001:0db8:85a3:0000:0000:8a2e:0370:7334कोई मेल नहीं: 192.168.1.1

MAC Address

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

Matches a MAC address with colon or dash separators

मेल: 00:1A:2B:3C:4D:5Eकोई मेल नहीं: 001A2B3C4D5E

CIDR Notation

^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\/(?:3[0-2]|[12]?\d)$

Matches an IPv4 address with CIDR subnet notation

मेल: 192.168.1.0/24कोई मेल नहीं: 192.168.1.0/33

फ़ाइल और पाथ

File Extension

\.([a-zA-Z0-9]+)$

Extracts the file extension from a filename

मेल: document.pdfकोई मेल नहीं: no-extension

Unix File Path

^\/(?:[^\/ ]+\/)*[^\/ ]+$

Matches an absolute Unix/Linux file path

मेल: /usr/local/bin/nodeकोई मेल नहीं: relative/path

Windows File Path

^[a-zA-Z]:\\(?:[^\\/:*?"<>|\r\n]+\\)*[^\\/:*?"<>|\r\n]*$

Matches an absolute Windows file path

मेल: C:\Users\docs\file.txtकोई मेल नहीं: /usr/local/bin

Image File

\.(jpe?g|png|gif|bmp|svg|webp|ico|tiff?)$

Matches filenames with common image extensions

मेल: photo.jpgकोई मेल नहीं: script.js

पासवर्ड

Min 8 Characters

^.{8,}$

Matches any string with at least 8 characters

मेल: password123कोई मेल नहीं: short

Strong Password

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

Requires uppercase, lowercase, digit, and special character (min 8 chars)

मेल: P@ssw0rd!कोई मेल नहीं: password

No Spaces

^\S+$

Matches strings that contain no whitespace characters

मेल: no-spaces-hereकोई मेल नहीं: has spaces

Alphanumeric Only

^[a-zA-Z0-9]+$

Matches strings containing only letters and digits

मेल: abc123कोई मेल नहीं: hello world!

HTML और XML

HTML Tag

<\/?[a-zA-Z][a-zA-Z0-9]*[^>]*>

Matches opening and closing HTML tags

मेल: <div class="test">कोई मेल नहीं: plain text

HTML Comment

<!--[\s\S]*?-->

Matches HTML comments including multiline content

मेल: <!-- comment -->कोई मेल नहीं: // js comment

HTML Attribute

([a-zA-Z-]+)\s*=\s*"([^"]*)"

Extracts attribute name and value pairs from HTML elements

मेल: class="active"कोई मेल नहीं: no-attribute

Self-Closing Tag

<[a-zA-Z][a-zA-Z0-9]*[^>]*\/>

Matches self-closing HTML/XML tags like <br /> or <img />

मेल: <img src="test.png" />कोई मेल नहीं: <div>content</div>

विविध

UUID v4

^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$

Matches a UUID version 4 string (lowercase hex)

मेल: 550e8400-e29b-41d4-a716-446655440000कोई मेल नहीं: not-a-uuid

JWT Token

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

Matches the three-part structure of a JSON Web Token

मेल: eyJhbGci.eyJzdWIi.SflKxwRJकोई मेल नहीं: not.a.jwt.token

Markdown Link

\[([^\]]+)\]\(([^)]+)\)

Matches Markdown-style links [text](url)

मेल: [Google](https://google.com)कोई मेल नहीं: plain text link

Semantic Version

^v?(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-([\da-zA-Z-]+(?:\.[\da-zA-Z-]+)*))?$

Matches semantic version strings like 1.2.3 or v2.0.0-beta.1

मेल: v2.1.0-beta.1कोई मेल नहीं: 1.2

Base64 String

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

Matches valid Base64-encoded strings

मेल: SGVsbG8gV29ybGQ=कोई मेल नहीं: Hello World!!!

और जानें

Regex लाइब्रेरी: सामान्य पैटर्न जो आप वास्तव में उपयोग करेंगे

ईमेल, URL, तिथि, और अधिक के लिए regex पैटर्न का एक क्यूरेट किया गया संग्रह ब्राउज़ करें।

रेगेक्स लाइब्रेरी क्या है?

रेगेक्स लाइब्रेरी सामान्य सत्यापन और निष्कर्षण कार्यों के लिए रेगुलर एक्सप्रेशन पैटर्न का एक सुव्यवस्थित संग्रह है। हर बार शुरू से रेगेक्स लिखने के बजाय, आप ईमेल, URL, तारीख, IP पते और दर्जनों अन्य प्रारूपों के लिए परखे हुए पैटर्न ब्राउज़ कर सकते हैं।

5 मिनट का पठनपूरी गाइड पढ़ें

अक्सर पूछे जाने वाले प्रश्न