Regular expressions one more time

Posted on 2011-05-12
Last Modified: 2012-05-11
I just want ask another question. If for example I want to find all e mail addresses for domain how would i write regular expression. Is it possible to use find command with regular expression.
Question by:cer113
    LVL 41

    Expert Comment

    Q: I want to find all e mail addresses for domain 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, 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, 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 "" {} \;
    LVL 38

    Accepted Solution

    Here is regexp for email address

    In your case

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Suggested Solutions

    Title # Comments Views Activity
    Problem with .htaccess file 4 47
    wordpress email form 23 59
    Linux: disable vim auto-comment 7 34
    Notice: Undefined variable 5 18
    If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
    Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
    Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
    Video by: Phil
    This video goes over how to configure and start a jail in FreeBSD.  This video is meant to supplement the article included with this course.

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now