Hi All,
Facing issue in extraction of name from an email subject.
Input : “RE: 9967_Rihan Joshi ABC & Student Certificate”
Expected output : Rihan Joshi
Input : “RE: 6514_Archana & Student Certificate”
Expected Output : Archana
Any help would be appreciated.
Parvathy
(PS Parvathy)
2
Hi @Happy_Coding
Use this regex:
(?<=RE\:\s+\d+\_)[A-Za-z]+
Regards
Parvathy
(PS Parvathy)
3
Hi @Happy_Coding
Check out the below workflow:
Input = "RE: 9967_Rihan Joshi ABC & Student Certificate"
Output = System.Text.RegularExpressions.Regex.Match(Input,"(?<=RE\:\s+\d+_)[A-Za-z]+").Value.Trim()
Input = "RE: 6514_Archana & Student Certificate"
Output = System.Text.RegularExpressions.Regex.Match(Input,"(?<=RE\:\s+\d+_)[A-Za-z]+").Value.Trim()
Hope it helps!!
Yoichi
(Yoichi)
4
Hi,
Can you try the following expression?
System.Text.RegularExpressions.Regex.Match(yourString,"(?<=\d+_).*?(?=(\s[A-Z]+)?\s\W)").Value
Regards,
@Yoichi , Thanks It worked absolutely fine.
Can you help with one more
Input : RE: 9999_Rihan Joshi ABC & Students Certificate
Output : “9999_Rihan Joshi”
Input : RE: 9999_Rihan ABC & Students Certificate
Output : Rihan
Cheers
Parvathy
(PS Parvathy)
7
Hi @Happy_Coding
Try this:
Input = "RE: 9999_Rihan Joshi ABC & Students Certificate"
Output = System.Text.RegularExpressions.Regex.Match(Input,"(?<=\d+_).*?(?=(\s[A-Z]+)?\s\W)").Value.Trim()
Input = "RE: 9999_Rihan ABC & Students Certificate"
Output = System.Text.RegularExpressions.Regex.Match(Input,"(?<=\d+_).*?(?=(\s[A-Z]+)?\s\W)").Value.Trim()
Hope it helps!!
Parvathy
(PS Parvathy)
8
Hi @Happy_Coding
Check the below workflow for better understanding:
Input = "RE: 9999_Rihan Joshi ABC & Students Certificate"
Output = System.Text.RegularExpressions.Regex.Match(Input,"(?<=\d+_).*?(?=(\s[A-Z]+)?\s\W)").Value.Trim()
Input = "RE: 9999_Rihan ABC & Students Certificate"
Output = System.Text.RegularExpressions.Regex.Match(Input,"(?<=\d+_).*?(?=(\s[A-Z]+)?\s\W)").Value.Trim()
Regards
Yoichi
(Yoichi)
9
Hi,
Can you clarify you requirement a little more?
Do you need single expression for the above 2 examples or need 2 expressions independently?
If former, also clarify the condition to add numeric characters such as 9999?
Or need single expression for all the 4 examples (including the first post)?
Regards,