ईमेल रेगेक्स - ईमेल पते के लिए एक पैटर्न का परीक्षण करें
डिबग जावास्क्रिप्ट नियमित अभिव्यक्ति लाइव: हाइलाइट किए गए मिलान, कैप्चर समूह, झंडे और प्रतिस्थापन पूर्वावलोकन।
नतीजा
यह पृष्ठ एक व्यावहारिक ईमेल पैटर्न के साथ पहले से लोड किए गए रेगेक्स परीक्षक को खोलता है: (?<user>[a-zA-Z0-9._%+-]+)@(?<domain>[a-zA-Z0-9.-]+\.[a-zA-Z]{2,})। It captures the part before the @ into a named group called user and everything after it into domain, requiring a dot and at least a two-letter top-level domain. नमूना पाठ वैध पतों को उन स्ट्रिंग्स के साथ मिलाता है जिनका मिलान नहीं होना चाहिए, ताकि आप एक नज़र में पैटर्न की सीमाएं देख सकें।
एक आदर्श आरएफसी 5322 ईमेल रेगेक्स प्रसिद्ध रूप से बहुत बड़ा है और अभी भी पुष्टिकरण संदेश भेजने का विकल्प नहीं है। In practice, a pattern like this one is the right tool: it accepts the addresses real people type — including dots, plus-tags and hyphenated domains — and rejects obvious garbage like a double @ or a missing top-level domain. प्रत्येक नामित समूह में क्या आया, इसका निरीक्षण करने के लिए पाठ के नीचे मिलान सूची देखें।
Edit the sample text, paste your own address list, or tighten the pattern — every keystroke re-runs the expression and updates the highlights, the counter and the groups. जब पैटर्न व्यवहार करता है, तो इसे सीधे अपने फॉर्म सत्यापन या लॉग-पार्सिंग कोड में कॉपी करें।