[email imap automation] create a Regex to extract the href of the <a> wanted

  • Автор темы Автор темы Arthuro
  • Дата начала Дата начала
  • Теги Теги
    regex

Arthuro

Новичок
Регистрация
24.07.2019
Сообщения
18
Реакции
3
Баллы
3
Hello,

I found the email and now, I want to create a regex to catch the activation link.

It's myhtml :
HTML:
Развернуть Свернуть Копировать
<a href="https://lin.com/activation/NX1B4s3xh1ip" target="_blank" style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; cursor: pointer; word-wrap: break-word; word-break: break-word; color: #FFFFFF; text-decoration: none;">Specific word</a>

How can I do to exract the href in Zennoposter.

I have this regex :
HTML:
Развернуть Свернуть Копировать
.*href=\"(.*?)\".*>Specific word.*

it's match but zennoposter doesn't find/give me the way to select the capture group.

I made an online tester

The result in project maker :

01ic.png


could you help me please ?
 
Did you try our regex tester to create regular expression?
Image 11.png
 
thank you VladZen,

No, I didn't see before this tool. It pretty similar of the toold ine the email right ? But, I tried it, the tester found one "groups", like you see on the picture, so the regex works :
wb4v.png


But why the same regex on email processing, doesn't work ? The email processing doesn't show "groups" only "matches" :
01ic.png


Thank you
 
I would also like to know for what the "Groups" tab in the regex tester is. What are "groups"?
 
I would also like to know for what the "Groups" tab in the regex tester is. What are "groups"?

In my regex I specified which data I want to extract, here it's the href content.
So the groups contains all extract data wanted, it can be more.

Look you can see in this pictures, in "groups" tabs : line 0, Number 1, I have my link who is my activation link :

wb4v.png
 
  • Спасибо
Реакции: morpheus93
Okay thank you. I think I got it :)
 
I don't see your images and can't answer you.
Please attach screenshots properly.
Here the regex you probably need:
(?<=<a\ href=")http.*?(?="\ target=)

I'm sorry, I didn't know, nobody saw my screenshot.
Thank you for your regex, it's perfect, not it's work. I didn't know the tips : (? ...) to not select.
 

Кто просматривает тему: (Всего: 0, Пользователи: 0, Гости: 0)