Good Job (for the Expression)!
Your expression is pretty good for what I guess you are trying to do. My guess is that you just want to see if there is one email in a string. Clearly, I don't see that we are going to extract any email (since your expression currently doesn't do that not to mention the strings are quite unstructured).
To answer your question, I'm pretty sure it would miss lots of input strings, but to begin with, we can just add an i
(insensitive) flag to the expression and remove A-Z
s:
(?i)[a-z0-9_.+-]+\s*at\s*[a-z0-9.-]+\s*[a-z0-9-]*\s*dot*\s*[a-z0-9-]{2,6}\s*(?:dot*\s*[a-z0-9-]{2,6})?
Example of What is Going to Miss:
For instance "dot co dot uk" types of emails are going to be missed. For that, we would add an optional non-capturing group: (?:dot*\s*[a-z0-9-]{2,6})?
##Not sure if a stand-alone regex would be the best solution!
Not sure if a stand-alone regex would be the best solution!
The problem you are having is very complicated. I'm sure there are alternative methods to solve your problem, but I'm not really good at offering solutions.
##Demo
Demo
import re
regex_pattern = r"(?i)[a-z0-9_.+-]+\s*at\s*[a-z0-9.-]+\s*[a-z0-9-]*\s*dot*\s*[a-z0-9-]{2,6}\s*(?:dot*\s*[a-z0-9-]{2,6})?"
emails = ["jane 94 at g mail dot com",
"9 at gmail dot com",
"jim doe at gmail dot com",
"I am jane doe at A.B. dot com",
"I am jane at AB dot com",
"just email happy jane doe seventy three at msn dot com",
"jane doe seven to seven at hotmail dot com"
"jane doe seven to seven at hotmail dot co dot uk"
]
for text in emails:
clean_text = re.sub(regex_pattern, '', text)
print(clean_text)
By the way, you can post your question on stackoverflow, where there are so many RegEx experts in there.
Good Job (for the Expression)!
Your expression is pretty good for what I guess you are trying to do. My guess is that you just want to see if there is one email in a string. Clearly, I don't see that we are going to extract any email (since your expression currently doesn't do that not to mention the strings are quite unstructured).
To answer your question, I'm pretty sure it would miss lots of input strings, but to begin with, we can just add an i
(insensitive) flag to the expression and remove A-Z
s:
(?i)[a-z0-9_.+-]+\s*at\s*[a-z0-9.-]+\s*[a-z0-9-]*\s*dot*\s*[a-z0-9-]{2,6}\s*(?:dot*\s*[a-z0-9-]{2,6})?
Example of What is Going to Miss:
For instance "dot co dot uk" types of emails are going to be missed. For that, we would add an optional non-capturing group: (?:dot*\s*[a-z0-9-]{2,6})?
##Not sure if a stand-alone regex would be the best solution!
The problem you are having is very complicated. I'm sure there are alternative methods to solve your problem, but I'm not really good at offering solutions.
##Demo
import re
regex_pattern = r"(?i)[a-z0-9_.+-]+\s*at\s*[a-z0-9.-]+\s*[a-z0-9-]*\s*dot*\s*[a-z0-9-]{2,6}\s*(?:dot*\s*[a-z0-9-]{2,6})?"
emails = ["jane 94 at g mail dot com",
"9 at gmail dot com",
"jim doe at gmail dot com",
"I am jane doe at A.B. dot com",
"I am jane at AB dot com",
"just email happy jane doe seventy three at msn dot com",
"jane doe seven to seven at hotmail dot com"
"jane doe seven to seven at hotmail dot co dot uk"
]
for text in emails:
clean_text = re.sub(regex_pattern, '', text)
print(clean_text)
By the way, you can post your question on stackoverflow, where there are so many RegEx experts in there.
Good Job (for the Expression)!
Your expression is pretty good for what I guess you are trying to do. My guess is that you just want to see if there is one email in a string. Clearly, I don't see that we are going to extract any email (since your expression currently doesn't do that not to mention the strings are quite unstructured).
To answer your question, I'm pretty sure it would miss lots of input strings, but to begin with, we can just add an i
(insensitive) flag to the expression and remove A-Z
s:
(?i)[a-z0-9_.+-]+\s*at\s*[a-z0-9.-]+\s*[a-z0-9-]*\s*dot*\s*[a-z0-9-]{2,6}\s*(?:dot*\s*[a-z0-9-]{2,6})?
Example of What is Going to Miss:
For instance "dot co dot uk" types of emails are going to be missed. For that, we would add an optional non-capturing group: (?:dot*\s*[a-z0-9-]{2,6})?
Not sure if a stand-alone regex would be the best solution!
The problem you are having is very complicated. I'm sure there are alternative methods to solve your problem, but I'm not really good at offering solutions.
Demo
import re
regex_pattern = r"(?i)[a-z0-9_.+-]+\s*at\s*[a-z0-9.-]+\s*[a-z0-9-]*\s*dot*\s*[a-z0-9-]{2,6}\s*(?:dot*\s*[a-z0-9-]{2,6})?"
emails = ["jane 94 at g mail dot com",
"9 at gmail dot com",
"jim doe at gmail dot com",
"I am jane doe at A.B. dot com",
"I am jane at AB dot com",
"just email happy jane doe seventy three at msn dot com",
"jane doe seven to seven at hotmail dot com"
"jane doe seven to seven at hotmail dot co dot uk"
]
for text in emails:
clean_text = re.sub(regex_pattern, '', text)
print(clean_text)
By the way, you can post your question on stackoverflow, where there are so many RegEx experts in there.
Good Job for(for the Expression)!
Your expression is pretty good for what I guess you are trying to do. My guess is that you just want to see if there is one email in a string. Clearly, I don't see that we are going to extract any email (since your expression currently doesn't do that not to mention the strings are quite unstructured).
To answer your question, I'm pretty sure it would miss lots of thingsinput strings, but hereto begin with, we can just add an i
(insensitive) flag to the expression and remove A-Z
s:
(?i)[a-z0-9_.+-]+\s*at\s*[a-z0-9.-]+\s*[a-z0-9-]*\s*dot*\s*[a-z0-9-]{2,6}\s*(?:dot*\s*[a-z0-9-]{2,6})?
Example of What is Going to Miss:
One example would beFor instance "dot co dot uk" types of emails that isare going to miss for whichbe missed. For that, we would add an optional non-capturing group: (?:dot*\s*[a-z0-9-]{2,6})?
##Not sure if a stand-alone regex would be the best solution!
The problem you are having is very complicated. I'm sure there are alternative methods to solve your problem, but I'm not really good at offering solutions.
##Demo
import re
regex_pattern = r"(?i)[a-z0-9_.+-]+\s*at\s*[a-z0-9.-]+\s*[a-z0-9-]*\s*dot*\s*[a-z0-9-]{2,6}\s*(?:dot*\s*[a-z0-9-]{2,6})?"
emails = ["jane 94 at g mail dot com",
"9 at gmail dot com",
"jim doe at gmail dot com",
"I am jane doe at A.B. dot com",
"I am jane at AB dot com",
"just email happy jane doe seventy three at msn dot com",
"jane doe seven to seven at hotmail dot com"
"jane doe seven to seven at hotmail dot co dot uk"
]
for text in emails:
clean_text = re.sub(regex_pattern, '', text)
print(clean_text)
By the way, you can post your question on stackoverflow, where there are so many RegEx experts in there.
Good Job for the Expression!
Your expression is pretty good for what I guess you are trying to do. My guess is that you just want to see if there is one email in a string. Clearly, I don't see that we are going to extract any email (since your expression currently doesn't do that).
To answer your question, I'm pretty sure it would miss lots of things, but here we can just add an i
(insensitive) flag to the expression and remove A-Z
s:
(?i)[a-z0-9_.+-]+\s*at\s*[a-z0-9.-]+\s*[a-z0-9-]*\s*dot*\s*[a-z0-9-]{2,6}\s*(?:dot*\s*[a-z0-9-]{2,6})?
Example of What is Going to Miss:
One example would be "dot co dot uk" types of emails that is going to miss for which we would add an optional non-capturing group: (?:dot*\s*[a-z0-9-]{2,6})?
##Not sure if a stand-alone regex would be the best solution!
I'm sure there are alternative methods to solve your problem, but I'm not really good at offering solutions.
##Demo
import re
regex_pattern = r"(?i)[a-z0-9_.+-]+\s*at\s*[a-z0-9.-]+\s*[a-z0-9-]*\s*dot*\s*[a-z0-9-]{2,6}\s*(?:dot*\s*[a-z0-9-]{2,6})?"
emails = ["jane 94 at g mail dot com",
"9 at gmail dot com",
"jim doe at gmail dot com",
"I am jane doe at A.B. dot com",
"I am jane at AB dot com",
"just email happy jane doe seventy three at msn dot com",
"jane doe seven to seven at hotmail dot com"
"jane doe seven to seven at hotmail dot co dot uk"
]
for text in emails:
clean_text = re.sub(regex_pattern, '', text)
print(clean_text)
By the way, you can post your question on stackoverflow, where there are so many RegEx experts in there.
Good Job (for the Expression)!
Your expression is pretty good for what I guess you are trying to do. My guess is that you just want to see if there is one email in a string. Clearly, I don't see that we are going to extract any email (since your expression currently doesn't do that not to mention the strings are quite unstructured).
To answer your question, I'm pretty sure it would miss lots of input strings, but to begin with, we can just add an i
(insensitive) flag to the expression and remove A-Z
s:
(?i)[a-z0-9_.+-]+\s*at\s*[a-z0-9.-]+\s*[a-z0-9-]*\s*dot*\s*[a-z0-9-]{2,6}\s*(?:dot*\s*[a-z0-9-]{2,6})?
Example of What is Going to Miss:
For instance "dot co dot uk" types of emails are going to be missed. For that, we would add an optional non-capturing group: (?:dot*\s*[a-z0-9-]{2,6})?
##Not sure if a stand-alone regex would be the best solution!
The problem you are having is very complicated. I'm sure there are alternative methods to solve your problem, but I'm not really good at offering solutions.
##Demo
import re
regex_pattern = r"(?i)[a-z0-9_.+-]+\s*at\s*[a-z0-9.-]+\s*[a-z0-9-]*\s*dot*\s*[a-z0-9-]{2,6}\s*(?:dot*\s*[a-z0-9-]{2,6})?"
emails = ["jane 94 at g mail dot com",
"9 at gmail dot com",
"jim doe at gmail dot com",
"I am jane doe at A.B. dot com",
"I am jane at AB dot com",
"just email happy jane doe seventy three at msn dot com",
"jane doe seven to seven at hotmail dot com"
"jane doe seven to seven at hotmail dot co dot uk"
]
for text in emails:
clean_text = re.sub(regex_pattern, '', text)
print(clean_text)
By the way, you can post your question on stackoverflow, where there are so many RegEx experts in there.
Good Job for the Expression!
Your expression is pretty good for what I guess you are trying to do. My guess is that you just want to see if there is one email in a string. Clearly, I don't see that we are going to extract any email (since your expression currently doesn't do that).
To answer your question, I'm pretty sure it would miss lots of things, but here we can just add aan i
(insensitive) flag to the expression and remove A-Z
s:
(?i)[a-z0-9_.+-]+\s*at\s*[a-z0-9.-]+\s*[a-z0-9-]*\s*dot*\s*[a-z0-9-]{2,6}\s*(?:dot*\s*[a-z0-9-]{2,6})?
Example of What is Going to Miss:
One example would be "dot co dot uk" types of emails that is going to miss for which we would add an optional non-capturing group: (?:dot*\s*[a-z0-9-]{2,6})?
##Not sure if thisa stand-alone regex would be the best solution!
I'm sure there are alternative methods to solve your problem, but I'm not really good at offering solutions.
##Demo
import re
regex_pattern = r"(?i)[a-z0-9_.+-]+\s*at\s*[a-z0-9.-]+\s*[a-z0-9-]*\s*dot*\s*[a-z0-9-]{2,6}\s*(?:dot*\s*[a-z0-9-]{2,6})?"
emails = ["jane 94 at g mail dot com",
"9 at gmail dot com",
"jim doe at gmail dot com",
"I am jane doe at A.B. dot com",
"I am jane at AB dot com",
"just email happy jane doe seventy three at msn dot com",
"jane doe seven to seven at hotmail dot com"
"jane doe seven to seven at hotmail dot co dot uk"
]
for text in emails:
clean_text = re.sub(regex_pattern, '', text)
print(clean_text)
By the way, you can post your question on stackoverflow , where there are so many RegEx experts in there.
Good Job for the Expression!
Your expression is pretty good for what I guess you are trying to do. My guess is that you just want to see if there is one email in a string. Clearly, I don't see that we are going to extract any email (since your expression currently doesn't do that).
To answer your question, I'm pretty sure it would miss lots of things, but here we can just add a i
flag to the expression:
(?i)[a-z0-9_.+-]+\s*at\s*[a-z0-9.-]+\s*[a-z0-9-]*\s*dot*\s*[a-z0-9-]{2,6}\s*(?:dot*\s*[a-z0-9-]{2,6})?
One example would be "dot co dot uk" types of emails that is going to miss for which we would add an optional non-capturing group: (?:dot*\s*[a-z0-9-]{2,6})?
##Not sure if this would be the best solution!
I'm sure there are alternative methods to solve your problem, but I'm not really good at offering solutions.
##Demo
import re
regex_pattern = r"(?i)[a-z0-9_.+-]+\s*at\s*[a-z0-9.-]+\s*[a-z0-9-]*\s*dot*\s*[a-z0-9-]{2,6}\s*(?:dot*\s*[a-z0-9-]{2,6})?"
emails = ["jane 94 at g mail dot com",
"9 at gmail dot com",
"jim doe at gmail dot com",
"I am jane doe at A.B. dot com",
"I am jane at AB dot com",
"just email happy jane doe seventy three at msn dot com",
"jane doe seven to seven at hotmail dot com"
"jane doe seven to seven at hotmail dot co dot uk"
]
for text in emails:
clean_text = re.sub(regex_pattern, '', text)
print(clean_text)
Good Job for the Expression!
Your expression is pretty good for what I guess you are trying to do. My guess is that you just want to see if there is one email in a string. Clearly, I don't see that we are going to extract any email (since your expression currently doesn't do that).
To answer your question, I'm pretty sure it would miss lots of things, but here we can just add an i
(insensitive) flag to the expression and remove A-Z
s:
(?i)[a-z0-9_.+-]+\s*at\s*[a-z0-9.-]+\s*[a-z0-9-]*\s*dot*\s*[a-z0-9-]{2,6}\s*(?:dot*\s*[a-z0-9-]{2,6})?
Example of What is Going to Miss:
One example would be "dot co dot uk" types of emails that is going to miss for which we would add an optional non-capturing group: (?:dot*\s*[a-z0-9-]{2,6})?
##Not sure if a stand-alone regex would be the best solution!
I'm sure there are alternative methods to solve your problem, but I'm not really good at offering solutions.
##Demo
import re
regex_pattern = r"(?i)[a-z0-9_.+-]+\s*at\s*[a-z0-9.-]+\s*[a-z0-9-]*\s*dot*\s*[a-z0-9-]{2,6}\s*(?:dot*\s*[a-z0-9-]{2,6})?"
emails = ["jane 94 at g mail dot com",
"9 at gmail dot com",
"jim doe at gmail dot com",
"I am jane doe at A.B. dot com",
"I am jane at AB dot com",
"just email happy jane doe seventy three at msn dot com",
"jane doe seven to seven at hotmail dot com"
"jane doe seven to seven at hotmail dot co dot uk"
]
for text in emails:
clean_text = re.sub(regex_pattern, '', text)
print(clean_text)
By the way, you can post your question on stackoverflow , where there are so many RegEx experts in there.