Regex टेस्टर
// रियल-टाइम मैचिंग के साथ रेगुलर एक्सप्रेशन टेस्ट और डिबग करें
लाइव मैचिंग
regex पैटर्न या टेस्ट स्ट्रिंग टाइप करते ही मैच तुरंत अपडेट होते हैं।
दृश्य परिणाम
मैच हुआ टेक्स्ट टेस्ट स्ट्रिंग में रंगीन बैकग्राउंड से हाइलाइट होता है।
पैटर्न लाइब्रेरी
ईमेल, URL, फोन नंबर, IP पते और तारीखों के लिए सामान्य regex पैटर्न त्वरित संदर्भित।
// REGEX
JavaScript RegExp:
Regular expressions (regex) are patterns used to match character combinations in strings. JavaScript supports flags: g (global), i (case-insensitive), m (multiline), s (dotAll), and u (unicode).
Example:
/\\d+/g matches "abc123def456" → ["123", "456"]
Use Cases:
- >Form validation: email, phone, URL
- >Text search and replace
- >Data extraction and web scraping
- >Log file analysis
- >Input sanitization
>> FAQ
Q: What is regex?
A: A regular expression is a sequence of characters that defines a search pattern for string matching, searching, and replacing.
Q: What do flags mean?
A: g (global) finds all matches. i ignores case. m (multiline) makes ^ and $ match line starts/ends. s (dotAll) makes . match newlines. u (unicode) enables full Unicode.
Q: What are capture groups?
A: Capture groups are created with parentheses () in a regex pattern to capture matched text for later reference.
Q: Greedy vs lazy matching?
A: Greedy quantifiers (*, +, {n,}) match as much text as possible. Lazy quantifiers (*?, +?, {n,}?) match as little as possible.
Q: Common regex patterns?
A: Email: [a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,} | URL: https?://[^\\s]+ | IP: \\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\b
// अन्य भाषाएँ
संदर्भ
हम परिणामों की जाँच कैसे करते हैं
हम नीचे दिए गए स्वचालित परीक्षणों से इस टूल की जाँच करते हैं। उदाहरणों के नाम उनकी मूल भाषा में हैं।
- Verification method
- Compare captures, global/case-insensitive results and Unicode zero-width match indices.
- Comparison reference
- Native JavaScript RegExp.matchAll.
- Verification scope
- Both use the same JS regex engine: this checks page iteration/presentation, not a second regex engine.
Test source and cases (select a file to read it)
-
parser-reliability.test.js
- Regex tester: captures, global matching and zero-width Unicode matches agree with native matchAll
ये परीक्षण दिए गए उदाहरणों और सीमाओं को जाँचते हैं, हर संभावित इनपुट को नहीं। उलटा रूपांतरण या उसी लाइब्रेरी से जाँच स्वतंत्र सत्यापन नहीं है।