RegEx Parse email info
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hello,
I'm not very experienced with regex and I have a field I'm trying to parse the email information from whether it has an address or shows 'None'
INPUT:
[{'fullName': 'user name', 'email': 'user.name@emailaddress.com'}]
[{'email': None}]}, {'displayUserInfo': [{'email': None}]
[{'email': 'user@emailaddress.com'}]
[{'fullName': 'name user', 'email': 'nameuser@gmail.com', 'company': 'Company Name, LLC'}]
DESIRED:
None
nameuser@gmail.com
Using Regex101 I used the below and it does parse out the email address but it doesn't work in the RegEx tool.
\'email\'\:\s\'(.+?)\'
Solved! Go to Solution.
- Labels:
- Parse
- Preparation
- Regex
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@kathleenmonks Thanks so much, I figured it was something 'easy'. In the data coming in so far is just '.com' but what if other domains start to appear? i.e .edu, .net, .org, etc...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
'email': '(.*\.[[:alpha:]]{3})'
This will change it to look for a period followed by any three letters - so that can work for those other domains. Nice call! If this solves your problem, please be sure to mark as the solution!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@kathleenmonks Perfect. Thank you for the help and quick response.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@kathleenmonks, Bringing this back to the top. Thanks again for your help before. In some new data I'm getting email addresses with varying character counts for the domain (.com, .it, .world, .kitchen, .company, properties, etc...)
Currently, I'm using the below regex to pick up the ones that have 2 and 3 character domains. Instead of adding new formulas for 4 - 10, is there a regex formula to parse the email addresses that have anywhere from 2 or more characters for their domains?
Current regex:
('email': '(.*\.[[:alpha:]]{3})')|('email': '(.*\.[[:alpha:]]{2})')
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @BonusCup,
An alternative to using RegEx here is to use the JSON parse tool. You would first need to change the single quotes to double quotes, but then you could pick up every possible variation of the email address given that it comes after 'email':
Attached is an example of how this would work. I changed one of your original examples to .world
![](/skins/images/303A6AD65FCA043F1D2938424191616C/responsive_peak/images/icon_anonymous_message.png)