Text parser get email

Hi guys,

Could you help me write the correct pattern for getting the email adress correctly pleas? Thanks a lot!

Hey @augustinb , you can use something like this:

(?<=mailto\:)(.+?)(?=\|)

Looks like this:

Next time, adding the email and such as text helps a lot more (then people can just copy paste it :wink: ).

1 Like

Hi. If you do not want fire a step you can use it direclty in the mapped mail field:

{{replace(replace(“mailto:address@mail.com”; “<mailto:”; emptystring); “>”; emptystring)}}

If you need additional support, please don’t hesitate to reach out.

Cheers
//HFBR

1 Like

Thanks a lot!
good to know, sorry I am new here :joy:

2 Likes

No problem @augustinb ! :smiley:
Let me know if you need any other assistance

1 Like

Heya @augustinb welcome to the community :wave:

I see that Bjorn’s comment :arrow_down: helped point you in the right direction, that’s awesome :slight_smile:

In case it is the ultimate answer to your question, could you please :white_check_mark: mark the reply as a solution?

It helps keep the community space tidy :blush:

Thanks a lot!



Hey Bjorn, I am not sure it works correctly for me.

I have this json code, from which i want to extract email, gender and name (in bold in the json).

I use the text parser module. Pattern is: (?<=mailto:)(.+?)(?=|)\ngenre: (?.)\nnom: (?.)
Text is: {{get(map(get(map(16.attachments; “fields”); 1); “value”; “title”; “Balises”); 1)}}

Thanks a lot for your help

JSON INPUT

[
{
“type”: “message”,
“subtype”: “bot_message”,
“text”: “Bonjour Augustin :wave: \nUn nouveau traitement est disponible sur la plateforme Dataleon :rainbow:\n\n”,
“ts”: “1674030628.668739”,
“bot_id”: “B04H77L1Y6N”,
“blocks”: [
{
“type”: “rich_text”,
“block_id”: “OYcl”,
“elements”: [
{
“type”: “rich_text_section”,
“elements”: [
{
“type”: “text”,
“text”: "Bonjour Augustin "
},
{
“type”: “emoji”,
“name”: “wave”,
“unicode”: “1f44b”
},
{
“type”: “text”,
“text”: " \nUn nouveau traitement est disponible sur la plateforme Dataleon "
},
{
“type”: “emoji”,
“name”: “rainbow”,
“unicode”: “1f308”
}
]
}
]
}
],
“attachments”: [
{
“id”: 1,
“footer_icon”: “https://uploads-ssl.webflow.com/6263ca4a5e32dab07539b0d3/6265c047776abb1a6c73cb71_6185a98d92e40f90970cf969_favicon.png”,
“ts”: 1674030628,
“color”: “4ee662”,
“fallback”: “[no preview available]”,
“author_name”: “dataleon”,
“author_link”: “https://dataleon.ai/”,
“author_icon”: “https://uploads-ssl.webflow.com/6263ca4a5e32dab07539b0d3/6265c047776abb1a6c73cb71_6185a98d92e40f90970cf969_favicon.png”,
“footer”: “Dataleon Platform”,
“fields”: [
{
“value”: “0e053ec1-5aae-40e6-bc33-a835321bca20”,
“title”: “ID”,
“short”: false
},
{
“value”: “Bank statements v4”,
“title”: “API”,
“short”: true
},
{
“value”: “Mon espace :wave:”,
“title”: “Espace de travail”,
“short”: true
},
{
“value”: “TRAITÉ”,
“title”: “Statut”,
“short”: true
},
{
“value”: “1s”,
“title”: “Temps de traitement”,
“short”: true
},
{
“value”: “0”,
“title”: “Nombre de documents”,
“short”: true
},
{
“value”: “0”,
“title”: “Nombre de pages”,
“short”: true
},
{
“value”: “Augustin BELLET”,
“title”: “Utilisateur”,
“short”: true
},
{
“value”: “”,
“title”: “Catégorie”,
“short”: true
},
{
“value”: “email: <mailto:augustinbellet0@gmail.com|augustinbellet0@gmail.com>\ngenre: Monsieur\nnom: Bellet”,
“title”: “Balises”,
“short”: false
},
{
“value”: “<https://console.dataleon.ai/fr/wks/wk_k7KlVpHTZ4/dashboard/analytics/0e053ec1-5aae-40e6-bc33-a835321bca20/document/0e053ec1-5aae-40e6-bc33-a835321bca20/document|Accéder à la plateforme>”,
“title”: “Lien”,
“short”: false
}
]
}
],
“date”: “2023-01-18T08:30:28.000Z”
}
]

Thanks for your answer, the problem is that I need other data (text) from the input json code.

Hey @augustinb , this should work for you.

(?<=mailto:)(.+?)(?=\|)|(?<=\\ngenre\: )(.+?)(?=\\)|(?<=\\nnom\: )(.+?)(?=\”)

If you want all bundles to be together again, use an array aggregator after the text parser to put it all in an array:

1 Like