Помогите с регуляркой



  • Нужно из письма:

    From: Kellogg’s Account Notifications <no-reply@account.na.kelloggs.com> 
    To: zawkwar228+zoggew@gmail.com 
    Subject: Please Activate Your Account 
    Delivered-To: zawkwar228+zoggew@gmail.com 
    Received: by 2002:a2e:7219:0:0:0:0:0 with SMTP id n25csp31921ljc; Tue, 30 Mar 2021 21:25:42 -0700 (PDT) 
    X-Google-Smtp-Source: ABdhPJzX/8lbOrXgwdRslCzYN+uJpSvSeXImrQS7eAEwnaWLIprNpabaz6dEGJjsYZtmPJf6J1EC 
    X-Received: by 2002:a17:902:7585:b029:e6:cc10:61fe with SMTP id j5-20020a1709027585b02900e6cc1061femr1413038pll.23.1617164742200; Tue, 30 Mar 2021 21:25:42 -0700 (PDT) 
    ARC-Seal: i=1; a=rsa-sha256; t=1617164742; cv=none; d=google.com; s=arc-20160816; b=xRFZAlNJ13LWRyNrtIQgMUwwmnaKv3YqmEu09sE/SAPe7JwHrslsKtW5ts8TZI968a zC/Gc3ZglTYzM+KzMj9SYOxYo2w4DWFhM86ZAtpELFy9VlIp6B917wmM+t4XM5miLMxj UZjlJLgTkx5UdbK6ACKWJY6j+mto1m8odCCqWxy05yY6gNojz9u0zEDnyV2Z5/ZAP8l7 KWEGzl+8XmjzUgVXH2gdNWqnMs4rXlKzICDgyJRwCaUBBJ8va73fvJnKjB3Po+X2HgNq xMNRfVg8D+xnJU7tP3ncZfiAPp+gbDqAUtwcDDXTEnhYqinakNitbdPY98d/6ruF6MNg A30w== 
    ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:to:message-id:subject:date:from:dkim-signature; bh=TmgUxvplwlmc+FMsonzmwOBD2fOcXM8oysDw6TF2pTQ=; b=Q6UQA7bH9kBA4KlxRhCnvstIOqlkAiuZFG9g2yMhVXSpyvw+4G+bLTnqsVHg56IG9T unPzL438SK7HcDGjQIkhnqdUUSFX+hD14zf4Yd5wJMt017J7Lk8k9wEQhhYg8CsBWfQp KWZ3Oiad9u9vRvxaBKFM3j4jLZURFtz1Fnqr74clixOvttJAmZVeqxbAWJ30KHy4b2SK WRIYP0QTIo12B9K4Z3zKQFzNuc39VLFetNt6jKQ+98xEFttp8vUmk0A9oJBm6tudRwFp 3eHkd0hMTVLex4bMrOJ/rPsaWtHepBYtD0qzuM4KnxGBCFl1b0QXsdW78/NvBKRfhGm7 c1+A== 
    ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@account.na.kelloggs.com header.s=scph0320 header.b=01hrA98y; spf=pass (google.com: domain of msprvs1=18724uapt3inp=bounces-209384-93@spmailtechno.com designates 147.253.217.19 as permitted sender) smtp.mailfrom="msprvs1=18724UapT3InP=bounces-209384-93@spmailtechno.com"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=kelloggs.com 
    Return-Path: <msprvs1=18724UapT3InP=bounces-209384-93@spmailtechno.com> 
    Received: from mta-217-19.sparkpostmail.com (mta-217-19.sparkpostmail.com. [147.253.217.19]) by mx.google.com with ESMTPS id m19si1244655pls.214.2021.03.30.21.25.41 for <zawkwar228+zoggew@gmail.com> (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Mar 2021 21:25:42 -0700 (PDT) 
    Received-SPF: pass (google.com: domain of msprvs1=18724uapt3inp=bounces-209384-93@spmailtechno.com designates 147.253.217.19 as permitted sender) client-ip=147.253.217.19; 
    Authentication-Results: mx.google.com; dkim=pass header.i=@account.na.kelloggs.com header.s=scph0320 header.b=01hrA98y; spf=pass (google.com: domain of msprvs1=18724uapt3inp=bounces-209384-93@spmailtechno.com designates 147.253.217.19 as permitted sender) smtp.mailfrom="msprvs1=18724UapT3InP=bounces-209384-93@spmailtechno.com"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=kelloggs.com 
    X-MSFBL: 8X0fwo21Tl+r698eOGxyTHwEhuj/rwxnqTGJyzQPXZ4=|eyJ0ZW5hbnRfaWQiOiJ zcGMiLCJtZXNzYWdlX2lkIjoiNjA1OWM1Zjk2MzYwNTFkM2Y5NzQiLCJyIjoiemF 3a3dhcjIyOCt6b2dnZXdAZ21haWwuY29tIiwic3ViYWNjb3VudF9pZCI6IjkzIiw iY3VzdG9tZXJfaWQiOiIyMDkzODQifQ== 
    DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=account.na.kelloggs.com; s=scph0320; t=1617164741; i=@account.na.kelloggs.com; bh=TmgUxvplwlmc+FMsonzmwOBD2fOcXM8oysDw6TF2pTQ=; h=From:Date:Subject:Message-Id:To:Content-Type; b=01hrA98yTgSiCkaevQT6cWtv78a2Y1eTeQNYZqHPWga8W2iecS3s3t4sv9YpJE5BW ChAZHs7AfvzDUxVHj3wn55kAld+MhVDa0iskO83Zg1IXRMIjhywnLljHDyx/g82Nh8 X61dK7CRbQc0tHN9Dv9TwgQYYnhkClfVSfVySeEg= 
    Authentication-Results: aa.mta1vsmtp.cc.prd.sparkpost smtp.user=<hidden>; auth=pass (LOGIN) 
    Received: from [34.200.97.129] ([34.200.97.129:47340] helo=external.gigya-ext.com) by aa.mta1vsmtp.cc.prd.sparkpost (envelope-from <no-reply@account.na.kelloggs.com>) (ecelerity 4.3.1.85456 r(Core:4.3.1.74)) with ESMTPSA (cipher=AES-256-GCM) id 9F/47-61149-5C9F3606; Wed, 31 Mar 2021 04:25:41 +0000 
    Received: by external.gigya-ext.com (Postfix, from userid 0) id 9475D583AC9F; Wed, 31 Mar 2021 00:25:40 -0400 (EDT) 
    Received: from [10.8.138.9] (unknown [10.8.138.9]) by mailraas2.gigya-raas.com (Postfix) with ESMTPS id 87EE228172C4 for <zawkwar228+zoggew@gmail.com>; Wed, 31 Mar 2021 00:25:40 -0400 (EDT) 
    Date: Wed, 31 Mar 2021 00:25:40 -0400 
    Message-Id: <VQNCV5LMCDU4.651LBLN24XXV@us1d-nomad-s130> 
    X-Site: 655883739870 
    X-Partnerid: 14453000 
    MIME-Version: 1.0 
    Content-Type: multipart/alternative; boundary="=-sQhTvMgccBz6Svfxuvdf8A==" 
    
    
    Hi , 
    
    Thank you for registering! To complete your account creation, please use the code below to activate your account. 
    
    This code will expire 5 minutes after this email was sent. If the code has expired, please return to the screen or login to receive a new code 
    
    137644 
    
    If you did not attempt to create an account, please Contact us 
    and mention keyword "DID NOT ATTEMPT" when reporting it to 
    us. 
    
    Note: Please do not respond to this message, as this email 
    address is not monitored. 
    
    ®, ™, © 2020 Kellogg NA Co. 
    Privacy 
    Terms of Use 
    
    <html xmlns="http://www.w3.org/1999/xhtml"> 
    <head> 
    <META name="from" content=" Kellogg’s Account Notifications <no-reply@account.na.kelloggs.com>" /> 
    <META name="subject" content="Please Activate Your Account " /> 
    <style> 
    p{ 
    margin-top: 20px; 
    } 
    a{ 
    color: #0000ee; 
    } 
    ul { 
    list-style-type: none; 
    margin: 0; 
    padding: 0; 
    overflow: hidden; 
    } 
    
    li { 
    float: left; 
    padding: 20px 10px; 
    position: relative; 
    } 
    
    li a { 
    display: block; 
    color: #0000ee; 
    text-align: center; 
    text-decoration: underline; 
    } 
    
    li a:hover { 
    color: #0000ee; 
    } 
    li:after { 
    z-index: 1; 
    } 
    li:last-child:after { 
    border-right:none; 
    } 
    .logo-image img{ 
    width:390px; 
    margin-top: 20px; 
    } 
    </style> 
    </head> 
    <body style="font-family: Arial; font-size: 13px; line-height: 16px;"> 
    <div style="width: 450px; padding:13px 0; margin:0 auto;margin-top: 30px;"> 
    <div style=" margin: 0 auto; "> 
    <div style="padding:0px 20px 0px;margin: 0px auto;"> 
    <div class="logo-image"><img src="http://kellogg-h.assetsadobe.com/is/image/content/dam/kelloggs/kna/us/campaign/email-assets/common-elements/icons/KFR_BRAND_LOGOS_Updated.jpg"></div> 
    <img src = "http://kelloggprod.sc.omtrdc.net/b/ss/kelloggstage/1?AQB=1&gn=KFRVerifyEmailOpenEn&v0=KFRVerifyEmailOpenEn&AQE=1" /> 
    <p>Hi ,</p> 
    <p>Thank you for registering! To complete your account creation, please use the code below to activate your account. 
    </p> 
    <p>This code will expire 5 minutes after this email was sent. If the code has expired, please return to the screen or login to receive a new code</p> 
    <p>137644</p> 
    <p>If you did not attempt to create an account, please <a href="https://www.kelloggsfamilyrewards.com/en_US/contactUs.html?cid=KFRContactUsLink">Contact us</a><br>and mention keyword "DID NOT ATTEMPT" when reporting it to <br>us. 
    </p> 
    
    <p>Note: Please do not respond to this message, as this email <br>address is not monitored. 
    </p> 
    <footer style="padding: 0px 15px;display: inline-flex;"> 
    <ul style="padding: 0 10px;"><li style=" float:left;padding: 0 10px;list-style:none;border-right: 1px solid #000;margin: 20px 0;line-height: 12px;">  ®, ™, © 2020 Kellogg NA Co.</li><li style=" float:left;padding: 0 10px;list-style:none;border-right: 1px solid #000;margin: 20px 0;line-height: 12px;"><a href="https://www.kelloggcompany.com/en_US/privacy-policy.html?cid=KFRPolicyLink">Privacy</a></li><li style=" float:left;padding: 0 10px;list-style:none;margin: 20px 0;line-height: 12px;"><a href="https://www.kelloggcompany.com/en_US/legal.html?cid=KFRTermsLink">Terms of Use</a></li></ul></div> 
    </footer> 
    </div> 
    </div> 
    </div> 
    
    <img border="0" width="1" height="1" alt="" src="http://click.account.na.kelloggs.com/q/qQ_P9NyQjH_0ZcdXh9X4aQ~~/AAMx6AA~/RgRiRS1FPlcDc3BjQgpgWcX5Y2BR0_l0Uht6YXdrd2FyMjI4K3pvZ2dld0BnbWFpbC5jb21YBAAAAF0~"> 
    </body> 
    </html> 
    

    Выцепить это значение - 137644





  • @fuckyep ещё через xpath можно

    //p[contains(text(), "This code will expire 5 minutes after this email was sent")]/following::p[1]
    


  • @bigorat
    Спасибо большое)


Log in to reply
 

  • 5
  • 6
  • 4
  • 2
  • 3
  • 2
  • 2
  • 45