Fred.FlintStone&Barney-Rubble@BedRock.com
Execution Time(sec.): 0.000035 Raw Match Pattern: ^(?P<addr_spec>(?P<local_part>(?P<dot_atom>(?P<CFWS>(?P<CFWS_1>(?P<FWS>(?:(?P<WSP>\x20|\x09)*|\r\n)?(?P>WSP)+)?(?P<comment>\x28(?:(?P>FWS)?(?P<ccontent>(?P<ctext>((?![\s()\\])[\x01-\x7f]))|(?P<quoted_pair>\\(?P<text>(?![\n\r])[\x01-\x7f]))|(?:\x28(?:(?P>FWS)?(?P>ctext)|(?P>quoted_pair))(P>FWS)?\x29)))*(P>FWS)?\x29))*(?:(?P>CFWS_1)|(?P>FWS)))?(?P<dot_atom_text>(?P<atext>(?!["()<>\[\]:;@\\,.])[\x21-\x7E])+(?:\.(?P>atext)+)*)+(?P>CFWS)?)|(?P<quoted_string>(?P>CFWS)?\x22(?:(?P>FWS)?(?P<qcontent>(?P<qtext>(?![\t\n\r\x20\x22\x5c])[\x01-x7f])|(?P>quoted_pair)))*(?P>FWS)?\x22(?P>CFWS)?))@(?P<domain>(?P>dot_atom)|(?P<domain_literal>(?P>CFWS)?\x5b(?:(?P>FWS)?(?P<dcontent>(?P<dtext>(?![\t\r\n\x20\[\]\\])[\x01-\x7F])|(?P>quoted_pair)))*(?P>FWS)?\x5d(?P>CFWS)?)))$ PHP Code Example: <?php $sourcestring="your source string"; preg_match('/^(?P<addr_spec>(?P<local_part>(?P<dot_atom>(?P<CFWS>(?P<CFWS_1>(?P<FWS>(?:(?P<WSP>\x20|\x09)*|\r\n)?(?P>WSP)+)?(?P<comment>\x28(?:(?P>FWS)?(?P<ccontent>(?P<ctext>((?![\s()\\])[\x01-\x7f]))|(?P<quoted_pair>\\(?P<text>(?![\n\r])[\x01-\x7f]))|(?:\x28(?:(?P>FWS)?(?P>ctext)|(?P>quoted_pair))(P>FWS)?\x29)))*(P>FWS)?\x29))*(?:(?P>CFWS_1)|(?P>FWS)))?(?P<dot_atom_text>(?P<atext>(?!["()<>\[\]:;@\\,.])[\x21-\x7E])+(?:\.(?P>atext)+)*)+(?P>CFWS)?)|(?P<quoted_string>(?P>CFWS)?\x22(?:(?P>FWS)?(?P<qcontent>(?P<qtext>(?![\t\n\r\x20\x22\x5c])[\x01-x7f])|(?P>quoted_pair)))*(?P>FWS)?\x22(?P>CFWS)?))@(?P<domain>(?P>dot_atom)|(?P<domain_literal>(?P>CFWS)?\x5b(?:(?P>FWS)?(?P<dcontent>(?P<dtext>(?![\t\r\n\x20\[\]\\])[\x01-\x7F])|(?P>quoted_pair)))*(?P>FWS)?\x5d(?P>CFWS)?)))$/',$sourcestring,$matches); echo "<pre>".print_r($matches,true); ?> $matches Array: ( [0] => Fred.FlintStone&Barney-Rubble@BedRock.com [addr_spec] => Fred.FlintStone&Barney-Rubble@BedRock.com [1] => Fred.FlintStone&Barney-Rubble@BedRock.com [local_part] => Fred.FlintStone&Barney-Rubble [2] => Fred.FlintStone&Barney-Rubble [dot_atom] => Fred.FlintStone&Barney-Rubble [3] => Fred.FlintStone&Barney-Rubble [CFWS] => [4] => [CFWS_1] => [5] => [FWS] => [6] => [WSP] => [7] => [comment] => [8] => [ccontent] => [9] => [ctext] => [10] => [11] => [quoted_pair] => [12] => [text] => [13] => [14] => [15] => [dot_atom_text] => Fred.FlintStone&Barney-Rubble [16] => Fred.FlintStone&Barney-Rubble [atext] => d [17] => d [quoted_string] => [18] => [qcontent] => [19] => [qtext] => [20] => [domain] => BedRock.com [21] => BedRock.com )
<?php $sourcestring="your source string"; preg_match('/^(?P<addr_spec>(?P<local_part>(?P<dot_atom>(?P<CFWS>(?P<CFWS_1>(?P<FWS>(?:(?P<WSP>\x20|\x09)*|\r\n)?(?P>WSP)+)?(?P<comment>\x28(?:(?P>FWS)?(?P<ccontent>(?P<ctext>((?![\s()\\])[\x01-\x7f]))|(?P<quoted_pair>\\(?P<text>(?![\n\r])[\x01-\x7f]))|(?:\x28(?:(?P>FWS)?(?P>ctext)|(?P>quoted_pair))(P>FWS)?\x29)))*(P>FWS)?\x29))*(?:(?P>CFWS_1)|(?P>FWS)))?(?P<dot_atom_text>(?P<atext>(?!["()<>\[\]:;@\\,.])[\x21-\x7E])+(?:\.(?P>atext)+)*)+(?P>CFWS)?)|(?P<quoted_string>(?P>CFWS)?\x22(?:(?P>FWS)?(?P<qcontent>(?P<qtext>(?![\t\n\r\x20\x22\x5c])[\x01-x7f])|(?P>quoted_pair)))*(?P>FWS)?\x22(?P>CFWS)?))@(?P<domain>(?P>dot_atom)|(?P<domain_literal>(?P>CFWS)?\x5b(?:(?P>FWS)?(?P<dcontent>(?P<dtext>(?![\t\r\n\x20\[\]\\])[\x01-\x7F])|(?P>quoted_pair)))*(?P>FWS)?\x5d(?P>CFWS)?)))$/',$sourcestring,$matches); echo "<pre>".print_r($matches,true); ?>
$matches Array: ( [0] => Fred.FlintStone&Barney-Rubble@BedRock.com [addr_spec] => Fred.FlintStone&Barney-Rubble@BedRock.com [1] => Fred.FlintStone&Barney-Rubble@BedRock.com [local_part] => Fred.FlintStone&Barney-Rubble [2] => Fred.FlintStone&Barney-Rubble [dot_atom] => Fred.FlintStone&Barney-Rubble [3] => Fred.FlintStone&Barney-Rubble [CFWS] => [4] => [CFWS_1] => [5] => [FWS] => [6] => [WSP] => [7] => [comment] => [8] => [ccontent] => [9] => [ctext] => [10] => [11] => [quoted_pair] => [12] => [text] => [13] => [14] => [15] => [dot_atom_text] => Fred.FlintStone&Barney-Rubble [16] => Fred.FlintStone&Barney-Rubble [atext] => d [17] => d [quoted_string] => [18] => [qcontent] => [19] => [qtext] => [20] => [domain] => BedRock.com [21] => BedRock.com )