Hi hasnainzeenwala,

Here's a pretty good list of resources for learning Regular Expressions: http://www.regular-expressions.info/books.html
The site itself is a good resource. I believe Jeffrey Friedl (author of Mastering Regular Expressions) started and/or is involved with the site in some way.

Speaking of Mastering Regular Expressions, * that is definitely a book you should have. Don't worry too much about the title. The book starts off really nicely and covers a lot of ground by the time you've finished the chapters on using Regexes in Perl.

* The other thing I would recommend is to make sure your text editor gives you the ability to do search and replace with regular expressions. (If you look in your software's documentation it may say something like: "do search and replace with grep". That's Ok, that's what you want.) Use the text editor for EVERYTHING (emails, love letters, emailed love letters, etc.) You will quickly learn how often you can and will want to use regular expressions.

  1. * I would also recommend picking up either a book on UNIX like: UNIX in a Nutshell or UNIX Power Tools as both of them have coverage of Regular Expressions appropriate for beginners. However, and everyone may not agree with me here, you can also check out sed & awk which can be argued is entirely about pattern matching (what regular expressions do).
  2. * I'd also recommend a simple regular expressions application. I use Reggy for Mac OSX but there are a few others out there like RegexBuddy.
  3. UPDATE May.26.2011: Added links to UNIX books.


    "...the adversities born of well-placed thoughts should be considered mercies rather than misfortunes." — Don Quixote

    In reply to Re: Regular expressions by luis.roca
    in thread Regular expressions by hasnainzeenwala

    Title:
    Use:  <p> text here (a paragraph) </p>
    and:  <code> code here </code>
    to format your post, it's "PerlMonks-approved HTML":



  4. Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  5. Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  6. Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  7. Please read these before you post! —
  8. Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  9. You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  10. Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  11. See Writeup Formatting Tips and other pages linked from there for more info.