# Dynamic string extraction

**URL:** <https://forum.uipath.com/t/dynamic-string-extraction/279868>\
**Category:** Help\
**Tags:** studio, activities\
**Created:** [December 29, 2020, 4:49am UTC](https://forum.uipath.com/t/dynamic-string-extraction/279868 "2020-12-29T04:49:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nikita\_Naidu](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/nikita_naidu/32/190182_2.png) [@Nikita\_Naidu](https://forum.uipath.com/u/Nikita_Naidu)\
**Post date:** [December 29, 2020, 4:49am UTC](https://forum.uipath.com/t/dynamic-string-extraction/279868/1 "2020-12-29T04:49:32Z")

</div>

Hello everyone,

This is my input string “Nikhita,Naidu[nikhitanaidu@gmail.com](mailto:nikhitanaidu@gmail.com)” I want to get only the email id [nikhitaNaidu@gmail.com](mailto:nikhitaNaidu@gmail.com) as the output dynamically how do I do it ? I need the solution ASAP

Thanks  
Nikhita

---

<div class="post-metadata">

**Author:** ![Pradeep\_Shiv](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/pradeep_shiv/32/496519_2.png) [@Pradeep\_Shiv](https://forum.uipath.com/u/Pradeep_Shiv)\
**Post date:** [December 29, 2020, 4:56am UTC](https://forum.uipath.com/t/dynamic-string-extraction/279868/2 "2020-12-29T04:56:22Z")

</div>

Hello @Nikita_Naidu,

You can use Matches activity and pass your Input string and use the below-mentioned pattern to extract only Mail ID from it,

([a-zA-Z0-9.\_%-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,6})

Cheers  
@Nikita_Naidu

---

<div class="post-metadata">

**Author:** ![sarathi125](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/sarathi125/32/519448_2.png) [@sarathi125](https://forum.uipath.com/u/sarathi125)\
**Post date:** [December 29, 2020, 5:06am UTC](https://forum.uipath.com/t/dynamic-string-extraction/279868/3 "2020-12-29T05:06:35Z")

</div>

> [@Nikita\_Naidu](#):
>
> “Nikhita,Naidu[nikhitanaidu@gmail.com](mailto:nikhitanaidu@gmail.com)”

@Nikita_Naidu  
If there is no separator between the lastname and the email id then, it is not possible to extract the email id alone, we need to know which is the lastname, using that we can split the string and get the email id without any other manipulations.

From where you are getting this string, if you are getting it from the outlook, you can get the email id from their active directory instead.

---

<div class="post-metadata">

**Author:** ![NIVED\_NAMBIAR](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/nived_nambiar/32/169066_2.png) [@NIVED\_NAMBIAR](https://forum.uipath.com/u/NIVED_NAMBIAR)\
**Post date:** [December 29, 2020, 5:25am UTC](https://forum.uipath.com/t/dynamic-string-extraction/279868/4 "2020-12-29T05:25:20Z")

</div>

Hi @Nikita_Naidu

You can try with matches activitiy in Uipath

Already regex pattern is predefined for email so u can easily extract the email from the input string and get the results

Hope it helps you

Regards

Nived N 🤖

Happy Automation 😌😌😌
