Find the answer to your Linux question:
Results 1 to 4 of 4
Hi, I was wondering if there's any way to write a regular expression that searches for files with a range of multiple digits. i.e. Look for files between 756 and ...
  1. #1
    Just Joined!
    Join Date
    Oct 2008
    Posts
    2

    Regular Expression Help

    Hi,

    I was wondering if there's any way to write a regular expression that searches for files with a range of multiple digits.

    i.e. Look for files between 756 and 867 inclusively without finding files like 984 or 358

    Thanks!!

  2. #2
    Trusted Penguin Roxoff's Avatar
    Join Date
    Aug 2005
    Location
    Nottingham, England
    Posts
    3,392
    We get this sort of question all the time from people wanting help with their homework. As you are already aware (you did read the forum rules, didn't you...) homework questions are not allowed.

    Now I'm not suggesting that you might be doing homework when asking this question, but others will be, so I'm not going to answer this directly. But I'll give you a couple of good pointers:

    1. the man page for grep has quite a good section on regular expressions
    2. it might have something to do with the square bracket ']'.

    Linux user #126863 - see http://linuxcounter.net/

  3. #3
    Linux Newbie danielsmw's Avatar
    Join Date
    Nov 2006
    Location
    Clemson, SC / Charleston, SC
    Posts
    110
    Ditto what Roxoff said about the forum rules, but as another pointer... consider using pattern capturing with parentheses, especially if you have perl available, and think about what you could do once you've retrieved the values.
    Registered Linux User: #479567
    Asking a question? Read this page first.
    Now... sudo make me a sandwich.
    ratiocinativeroot.blogspot.com

  4. #4
    Just Joined!
    Join Date
    Oct 2008
    Posts
    2
    Thanks for the help!! =D

Posting Permissions

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