Regex extraction from html

{
“message”: " for a gasg hahsdf, which you can do <a style=‘font-size:12px; color: #fa5400; font-family:Helvetica, Arial, sans-serif; text-decoration:initial; font-weight: normal;’ href=“https://wtdmbt5c.r.us-east-1.awstrack.me/L0/https:%2F%2Funite.adfas.com%2Fs3%2Funite%2Fupdategasg.html%3FhahsdfKey=93749947-50e7-4c18-8f54-20b27b6515c8%26locale=en_SG%26redirectUrl=http:%2F%2Fwww.adfas.com%26backendEnvironment=identity/1/0100017970e4b3d6-7f71eebd-fdd1-4de2-a59d-148a0e540c53-000000/wMv2xEUxdR1qlkhArtK-0WchfkQ=214”>here. This link will expire in 1 hour.

Your new gasg must include:

  • 8-36 characters
  • At least 1 mixed-case letter
  • At least 1 number

If you did not initiate this gasg hahsdf, please <a style=‘font-size:12px; color: #fa5400; font-family:Helvetica, Arial, sans-serif; text-decoration:underline; font-weight: normal;’ href=“https://wtdmbt5c.r.us-east-1.awstrack.me/L0/https:%2F%2Fwww.adfas.com%2Fsg%2Fhelp%2F%23contact/1/0100017970e4b3d6-7f71eebd-fdd1-4de2-a59d-148a0e540c53-000000/62cgYRgxrIjRW6AQp7y-9Ofk0dU=214”>contact us.

Thanks,

adfas.com<table width=“100%” border=“0” cellpadding=“0” cellspacing=“0” style=“border:none; border-collapse:collapse; mso-table-lspace:0pt; mso-table-rspace:0pt;”><table width=“100%” border=“0” cellpadding=“0” cellspacing=“0” style=“border:none; border-collapse:collapse; mso-table-lspace:0pt; mso-table-rspace:0pt;”><td align=“left” bgcolor="#444444" style=“border:none; padding-top:14px; padding-bottom:14px;”><table border=“0” cellspacing=“0” cellpadding=“5” bgcolor="#444444" style=‘font-size: 12px; color: #ffffff; font-family:Helvetica, Arial, sans-serif; text-decoration:none; font-weight: normal; border:none;’> <a href=“https://wtdmbt5c.r.us-east-1.awstrack.me/L0/https:%2F%2Fagreementservice.svs.adfas.com%2Fsg%2Fen_sg%2Frest%2Fagreement%3FagreementType=privacyPolicy%26uxId=com.adfas.unite%26country=sg%26language=en%26requestType=redirect%26%3Fcp=gasghahsdf/1/0100017970e4b3d6-7f71eebd-fdd1-4de2-a59d-148a0e540c53-000000/ubCnRI-J5EiZdjv6Z7eKPfdT3Ag=214” style=‘color:#ffffff; text-decoration:none; white-space:nowrap;’>Privacy Policy<a href=“https://wtdmbt5c.r.us-east-1.awstrack.me/L0/https:%2F%2Fwww.adfas.com%2Fsg%2Fhelp/1/0100017970e4b3d6-7f71eebd-fdd1-4de2-a59d-148a0e540c53-000000/aILkZwmoHZhZZPR4tew63bM_vjg=214” style=‘color:#ffffff; text-decoration:none; white-space:nowrap;’>Get Help <td bgcolor="#444444" style=“border:none; padding-top:14px; padding-bottom:14px;”><table border=“0” cellspacing=“0” bgcolor="#444444" width=“100%” style=‘font-size: 12px; color: #ffffff; font-family:Helvetica, Arial, sans-serif; text-decoration:none; font-weight: normal; border:none;’>© 2021 adfas All rights reserved.<table width=“100%” border=“0” cellpadding=“0” cellspacing=“0” style=“border:none; border-collapse:collapse; mso-table-lspace:0pt; mso-table-rspace:0pt;”><table border=“0” cellspacing=“0” cellpadding=“0” bgcolor="#ffffff" width=“100%” style=‘font-size: 12px; color: #666666; font-family:Helvetica, Arial, sans-serif; text-decoration:none; font-weight: normal; border:none;’> <td align=“left” valign=“middle” style=“border:none; padding-top:20px; padding-bottom:30px;”>adfas European Operations Netherlands, B.V.
Colosseum 1, 1213 NL, Hilversum, The Netherlands

Please do not reply to this email. If you need to contact adfas
with questions or concerns, please <a href=“https://wtdmbt5c.r.us-east-1.awstrack.me/L0/https:%2F%2Fwww.adfas.com%2Fsg%2Fhelp%2F%23contact/2/0100017970e4b3d6-7f71eebd-fdd1-4de2-a59d-148a0e540c53-000000/heH8MfG3AyW8Gu8ZqoelGAQRcDI=214” style=‘font-size:12px; color: #fa5400; font-family:Helvetica, Arial, sans-serif; text-decoration:initial; font-weight: normal;’>click here.

\r\n", “level”: “Trace”, “logType”: “User”, “timeStamp”: “01:29:10”, “processVersion”: “1.0.0”, “jobId”: “ece44af3-4271-401f-8e1b-7525c481c62e”, “robotName”: “asdff11@gmail.com-attended”, “machineId”: 1352462, “organizationUnitId”: 1338806 }

please refer to the info above info. I did a regex.match and it returns nothing. It managed to extract properly in regex101 though. Anyone can assist? Appreciate your help.

regex.match(content,"((?<= href=\W\S).*(?=\W\W\Shere))").ToString

@Druidtier3 - What information you would like to extract from the above message?

@prasath17 I will need to extract the URL in the above message.

“href=“https://wtdmbt5c.r.us-east-1.awstrack.me/L0/https:%2F%2Funite.adfas.com%2Fs3%2Funite%2Fupdategasg.html%3FhahsdfKey=93749947-50e7-4c18-8f54-20b27b6515c8%26locale=en_SG%26redirectUrl=http:%2F%2Fwww.adfas.com%26backendEnvironment=identity/1/0100017970e4b3d6-7f71eebd-fdd1-4de2-a59d-148a0e540c53-000000/wMv2xEUxdR1qlkhArtK-0WchfkQ=214”>here. This link will expire in 1 hour.”

This needs to be extracted.

@Druidtier3 - Please try this…

Regex Pattern =  https:.+(?=\”\>here. This link will expire in 1 hour.)

Sample workflow with output

2 Likes

Hello actually @Druidtier3 extract data from mail so better use outlook to extract the data from the mail body

regards
Chethan P

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.