Stax

Regex टेस्टर

लाइव मैच हाइलाइटिंग और कैप्चर ग्रुप के साथ रेगुलर एक्सप्रेशन टेस्ट करें।

//g

Regex टेस्टर क्या है?

यह टूल regular expressions (regex) को live test करता है — pattern और test string डालें, matches तुरंत highlight होंगे। Capture groups अलग दिखते हैं। Email validation, log parsing, search-replace patterns के लिए ज़रूरी।

Regex टेस्टर का उपयोग कैसे करें

  1. Regex pattern दर्ज करें (जैसे \d+)।
  2. Flags चुनें: g (global), i (case-insensitive), m (multiline)।
  3. Test string डालें।
  4. Highlighted matches और capture groups देखें।

Common Regex patterns

  • Email: ^[\w.-]+@[\w.-]+\.[a-z]{2,}$
  • Indian phone: ^[6-9]\d{9}$
  • URL: https?://[\w.-]+
  • Hex color: ^#[0-9A-Fa-f]{6}$

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

Regex (Regular Expression) क्या है?
Regex pattern matching के लिए शक्तिशाली tool है। उदाहरण: \d+ matches सभी numbers, [a-z]+ matches lowercase words, ^https?:// matches URLs। Email validation, log parsing, search-replace के लिए ज़रूरी। हर programming language में built-in है।
Live testing कैसे काम करता है?
Pattern और test string डालें — matches तुरंत highlight होते हैं। Capture groups (parentheses में) अलग दिखते हैं। फ्लैग्स (g — global, i — case-insensitive, m — multiline) भी सपोर्ट हैं। Mistakes तुरंत दिखती हैं।
कुछ common regex patterns?
Email: ^[\w.-]+@[\w.-]+\.[a-z]{2,}$; Phone (Indian): ^[6-9]\d{9}$; Date (DD-MM-YYYY): ^\d{2}-\d{2}-\d{4}$; URL: https?://[\w.-]+(/[\w.-]*)*; Hex color: ^#[0-9A-Fa-f]{6}$।
Regex कब इस्तेमाल नहीं करना चाहिए?
HTML/XML parsing के लिए — proper parser इस्तेमाल करें (regex से HTML parse करना कुख्यात है)। बहुत complex patterns (nested) के लिए — code पढ़ने में आसान होगा। Performance critical loops में — pre-compile करें। Email validation के लिए simpler: just @ check करो।

संबंधित टूल्स