-1

Good day,

I typically write rather simple BASH scripts on a routine basis. I can get the majority of my tasks done via cut, echo, sed, and other command-line applications for parsing text, lists, etc.

I have a basic understanding of some simple regular expressions while using SED and VIM, but I am a complete stranger to AWK, and feel I should improve upon my understanding of regex.

Can anyone recommend any resources on this subject? Most of my Google searches have been fruitless or are mainly a few existing examples. My primary concern is gaining a solid generalized grasp of regex which I can then focus on SED, VIM, and AWK. I have already Googled a number of books on the topic, but they all seem to be focused on the ins-and-outs of the specific application with minimal emphasis on regex, while the books I find on regex seem to have no mention of SED or VIM, and instead focus on Perl, Python, and Ruby.

The end-goal is that I would like to be able to come up with one-liners like one other generous poster created in a previous question of mine at sed one-liner - Find delimiter pair surrounding keyword , or even more complex than that.

Any material would be helpful. A book, pocket reference, a website with a thorough tutorial, etc. I personally prefer small books as I can take them on the go, and have a hard-copy.

Thank you all in advance for your time and assistance.

Community
  • 1
  • 1
Cloud
  • 18,753
  • 15
  • 79
  • 153
  • 1
    http://pubs.opengroup.org/onlinepubs/9699919799/utilities/sed.html#tag_20_116_13_02 – William Pursell Aug 09 '12 at 17:11
  • 1
    You can get a surprising amount of work done with awk w/o needing/using regular expressions. This is the [book](http://www.amazon.com/The-AWK-Programming-Language-Alfred/dp/020107981X/ref=sr_1_2?ie=UTF8&qid=1344532209&sr=8-2&keywords=awk) I used to learn AWK, it's similar to K&R's C book, short and concise. Given how expensive new copies are (now, they didn't use to be back in the day ..), see if you can find a used one. – Levon Aug 09 '12 at 17:11
  • 1
    http://books.google.se/books/about/Mastering_Regular_Expressions.html?id=NYEX-Q9evKoC&redir_esc=y – Anders Aug 09 '12 at 17:14
  • 1
    @Dogbert. There's been a long time debate about whether book-recommendation questions make a good fit for SO. The conclusion, AFAIK, was against such questions. And hence someone might have downvoted. If you ask me, I don't find anything wrong with book-recommendation questions but the community is not so cool about it – Pavan Manjunath Aug 10 '12 at 09:38
  • @PavanManjunath Thank you. I take part in Q&A on this site, but not its history. I will refrain from book recommendation requests in the future. Are there sites where this is encouraged? (ie: programmers.stackexchange.com, etc). – Cloud Aug 13 '12 at 21:15

1 Answers1

2

According to me, this is the best regex tutorial on the net

Regex Tutorial

For sed and awk, may be this-

Sed and Awk One Liners

A few regex engines where you can try out your regexes are -

Regexpal

Regexpr

Pavan Manjunath
  • 27,404
  • 12
  • 99
  • 125
  • Thank you. Hard to believe I overlooked this. I will be buying a copy of the PDF from the author. :) – Cloud Aug 09 '12 at 17:21