Rajesh M. wrote in post #968280: > regular expression should only look for the string after digitals 0 6 * > * 0, here it should look for shutdown -y -g0 -i6 Have you tried searching for an online regexp reference, or used a regexp book? If so, which one? Things like "how to match a digit or asterisk" and "how to match a space" should be easy to find there. Also: are you actually trying to do this with grep/egrep? Or do you want to write something in ruby? -- Posted via http://www.ruby-forum.com/.