Regular expressions one more time

I just want ask another question. If for example I want to find all e mail addresses for domain me.com how would i write regular expression. Is it possible to use find command with regular expression.
cer113Asked:
Who is Participating?
 
wesly_chenCommented:
Here is regexp for email address
http://www.regular-expressions.info/email.html

In your case
[A-Z0-9._%+-]+@me.com
0
 
HonorGodSoftware EngineerCommented:
Q: I want to find all e mail addresses for domain me.com how would i write regular expression?
A: Regular Expressions work on text.  So, a regular expression could be written that can be used to process a text file, and locate instances of data that match the regular expression pattern.  So, if you had a text file that included, or contained the e-mail addresses for me.com, then a RegExp pattern could be written to locate these values in the text.

But, if you are trying to get a RegExp to magically determine all of the existing e-mail addresses for me.com, then this can not, and will not work.

RegExp patterns are used to process text.

Q: Is it possible to use find command with regular expression?
A: Yes.  But the RegExp would be used by some utility that is executed by the find command.
    For example, something like this perhaps:

find . -name "*.txt" -print -exec grep "@me.com" {} \;
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.