Find the answer to your Linux question:
Results 1 to 4 of 4
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Regular Expression

    How do I add a blank space to the egrep below? I want to search for
    port 25 and a blank? It must be an exact match 25 with a trailing blank.
    That is my search criteria. Currently anything that begins with 25 is returned.

    ex: 256 2567 25555 I only want matches on 25 and a space.

    egrep "to outside:[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\/25" /var/log/messages

  2. #2
    Linux Guru sarumont's Avatar
    Join Date
    Apr 2003
    Ummm...escape a space: "\ "
    "Time is an illusion. Lunchtime, doubly so."
    ~Douglas Adams, The Hitchhiker's Guide to the Galaxy

  3. #3
    Linux Guru lakerdonald's Avatar
    Join Date
    Jun 2004
    St. Petersburg, FL
    that should work.

  4. $spacer_open
  5. #4


    For some reason that doesn't work . It returns no matches. If you have a second try it out with my line.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts