Hi
How extract postal code value from regex
Example below is the txt
Postal Code
941332
Customer Service Representative (Optional)
output:
941332
- extract email from below test using regex
Email
jac.tiongsothtr@ucgfhng.edumailto:jac.tiongsothtr@ucgfhng.edu
Job Title (Optional)
output:
jac.tiongsothtr@ucgfhng.edu
please provide the solution
Thanks
Likitha
vrdabberu
(Varunraj Dabberu)
3
Hi @vinjam_likitha
1. Regular Expression to extract Postal Code:
Regex Expression: (?<=Postal Code\s*)\d+
Assign Syntax: System.Text.RegularExpressions.Regex.Match(Input,"(?<=Postal Code\s*)\d+").Value.Trim()
2. Regular Expression to extract Mail ID:
Regex Expression: [a-z.@]+(?=mailto)
Assign Syntax: System.Text.RegularExpressions.Regex.Match(Input,"[a-z.@]+(?=mailto)").Value.Trim()
Regards
naveen.s
(Naveen S)
4
Please try this:
postal_code_pattern = r’(?<=Postal Code\s+)(\d+)’
email_pattern = r’(?<=Email\s+)([\w.-]+@[\w.-]+(?:.[a-z]{2,}))’