<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>unixadminschool.com</title>
	<atom:link href="http://gurkulindia.com/main/feed/" rel="self" type="application/rss+xml" />
	<link>http://gurkulindia.com/main</link>
	<description></description>
	<lastBuildDate>Mon, 20 May 2013 15:31:59 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Virtual Lab : Get Your hands dirty with grep &amp; RegEx</title>
		<link>http://gurkulindia.com/main/2013/05/virtual-lab-get-your-hands-dirty-with-grep-regex/</link>
		<comments>http://gurkulindia.com/main/2013/05/virtual-lab-get-your-hands-dirty-with-grep-regex/#comments</comments>
		<pubDate>Fri, 17 May 2013 19:48:33 +0000</pubDate>
		<dc:creator>Ramdev</dc:creator>
				<category><![CDATA[Beginners Lessons]]></category>
		<category><![CDATA[Beginners zone]]></category>
		<category><![CDATA[Career Guidance]]></category>
		<category><![CDATA[Scripting]]></category>

		<guid isPermaLink="false">http://gurkulindia.com/main/?p=8457</guid>
		<description><![CDATA[  Regular expressions are extremely useful in extracting information from text such as code, log files, spreadsheets, or even documents. As an unix administrator we do regularly use the regex to perform various problem diagnosis , automation or remediation tasks. And it is almost impossible to imagine the life of unixadmin without RegEx usage. This [...]]]></description>
				<content:encoded><![CDATA[<p style="text-align: justify;"><span style="font-size: medium; line-height: 19px; font-family: georgia, palatino;"><a href="http://i0.wp.com/gurkulindia.com/main/wp-content/uploads/2013/05/grep-regex-title.jpg"><img class="size-medium wp-image-8443 alignleft" alt="Get Your Hands Dirty with Grep and RegEx" src="http://i0.wp.com/gurkulindia.com/main/wp-content/uploads/2013/05/grep-regex-title.jpg?resize=300%2C250" data-recalc-dims="1" /></a></span></p>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;"><span style="font-size: medium; line-height: 19px; font-family: georgia, palatino;">Regular expressions are extremely useful in extracting information from text such as code, log files, spreadsheets, or even documents. As an unix administrator we do regularly use the regex to perform various problem diagnosis , automation or remediation tasks. And it is almost impossible to imagine the life of unixadmin without RegEx usage. This quick virtual lab session will give you the basic usage knowledge of regular expressions with grep, which is a  essential skill required for unix system administrators.</span></p>
<p style="text-align: justify;"><span style="font-family: georgia, palatino; font-size: medium;"><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; line-height: 19px;"> </span></span> </p>
<p style="text-align: justify;"><span style="font-size: medium; font-family: georgia, palatino;">Below is the Learning Map, that makes you comfortable with Grep  and RegEx ( i.e. Regular Expressions) within a day:</span></p>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;"> <span id="more-8457"></span></p>
<p style="text-align: justify;"> </p>
<p style="text-align: center;"><span style="font-size: x-large;"><strong> <span style="color: #ff0000;"><a title="Linux Virtual Terminal" onclick="window.open('http://gurkulindia.com/main/lesson/linux-terminal/','Linux virtual Terminal','scrollbars=yes,resizable=yes,toolbar=yes,width=1100,height=900,left=b,top=r');return false;" href="http://gurkulindia.com/main/lesson/linux-terminal/" target="_blank"><span style="color: #ff0000;">Launch Your Linux Terminal for Exercises </span></a></span>  </strong></span></p>
<p style="text-align: center;"><span style="font-size: medium; color: #000000;"><strong>( <a onclick="window.open('http://gurkulindia.com/main/lesson/grep-regex-lab-setup-script/','Lab Setup for RegEx','scrollbars=yes,width=800,height=1000');return false;" href="http://gurkulindia.com/main/lesson/grep-regex-lab-setup-script/"><span style="color: #0000ff;">get your lab setup script here</span></a> )</strong></span></p>
<p>&nbsp;</p>
<p style="text-align: justify;"> </p>
<h3 style="text-align: justify;"><span style="font-size: medium; line-height: 19px; font-family: georgia, palatino;">Step 1 : Understand how do we search lines that matches particular words / numbers.       </span></h3>
<h3 style="text-align: justify;"><a href="http://gurkulindia.com/main/lesson/grep-regex-lesson1" target="_blank"><span style="color: #ff0000;"><strong>Try Now</strong></span></a></h3>
<h3 style="text-align: justify;"> </h3>
<blockquote>
<p style="text-align: justify;"><span style="font-size: medium; line-height: 19px; font-family: georgia, palatino;">The first thing to recognize when using regular expressions is that everything is essentially a character, and we are writing patterns to match a specific sequence of characters (also known as a string). Characters include normal letters, but digits as well. In fact, numbers 0-9 are also just characters and if you look at an ascii table, they are listed sequentially.     </span><span style="font-size: 1.17em; line-height: 19px;"> </span></p>
</blockquote>
<h3 style="text-align: justify;"> </h3>
<h3 style="text-align: justify;"><span style="font-size: medium; line-height: 19px; font-family: georgia, palatino;">Step 2 : Understand how to work with  &#8221;.&#8221; ( dot) while extracting data.                                     </span></h3>
<h3 style="text-align: justify;"><a href="http://gurkulindia.com/main/lesson/grep-regex-lesson2" target="_blank"><span style="color: #ff0000;"><strong>Try Now</strong></span></a></h3>
<h3 style="text-align: justify;"> </h3>
<blockquote>
<p style="text-align: justify;"><span style="font-size: medium; font-family: georgia, palatino;">In regular expressions, we are often matching pieces of text that we don&#8217;t know the exact contents of, other than the fact that they have some pattern (eg. are phone numbers for example). In  such cases we do use the dot as wildcard that can represent any character in a specific position of the word</span></p>
</blockquote>
<p style="text-align: justify;"> </p>
<h3 style="text-align: justify;"><span style="font-size: medium; line-height: 19px; font-family: georgia, palatino;">Step 3 :  Understand how to match the words that have specific characters.                            </span></h3>
<h3 style="text-align: justify;"><span style="font-size: medium; line-height: 19px; font-family: georgia, palatino;"> </span><a href="http://gurkulindia.com/main/lesson/grep-regex-lesson3"><span style="color: #ff0000;"><strong>Try Now</strong></span></a></h3>
<h3 style="text-align: justify;"> </h3>
<blockquote>
<p style="text-align: justify;"><span style="font-size: medium; font-family: georgia, palatino;">When you use the dot (.) as wild card, that will match to any character in the given position, it is useful but sometimes it is too powerful. Just incase if we want to match limited set of characters in a specific position we should go different kind of RegEx pattern.</span></p>
</blockquote>
<p style="text-align: justify;"> </p>
<h3 style="text-align: justify;"><span style="font-size: medium; line-height: 19px; font-family: georgia, palatino;">Step 4 :  Understand how to exclude words with specific characters.                                           </span></h3>
<h3 style="text-align: justify;"><a href="http://gurkulindia.com/main/lesson/grep-regex-lesson4" target="_blank"><span style="font-size: medium; line-height: 19px; font-family: georgia, palatino;"><strong><span style="color: #ff0000;">Try Now</span></strong></span></a></h3>
<blockquote>
<p style="text-align: justify;"><span style="font-size: medium; font-family: georgia, palatino;">When we have big list of matching characters that we are looking in a word our RegEx will become lengthier and  complex. In such cases, we can use RegEx to specify the characters that we dont want to see instead of mentioning big list of characters that we want to see.</span></p>
</blockquote>
<p style="text-align: justify;"> </p>
<h3 style="text-align: justify;"><span style="font-size: medium; font-family: georgia, palatino;">Step 5 : Understand how to use Character Ranges, instead of using  individual character list , while matching the words.     </span> </h3>
<h3 style="text-align: justify;"><a href="http://gurkulindia.com/main/lesson/grep-regex-lesson5" target="_blank"><span style="color: #ff0000;"><strong>Try Now</strong></span> </a></h3>
<blockquote>
<p style="text-align: justify;"><span style="font-size: medium; font-family: georgia, palatino;">If we want to match or exclude a large number of sequential characters? eg. Matching a…m but not n…z. Do we have to write [abcdefghijklm]? Not really required we can simply use the character ranges.</span></p>
</blockquote>
<p style="text-align: justify;"> </p>
<h3 style="text-align: justify;"><span style="font-size: medium; font-family: georgia, palatino;">Step 6 : Understand how to match words with arbitrary number of characters.     </span>                   </h3>
<h3 style="text-align: justify;"><a href="http://gurkulindia.com/main/lesson/grep-regex-lesson6"> <span style="font-size: medium; color: #ff0000;"><strong>Try Now</strong></span></a></h3>
<h3 style="text-align: justify;"> </h3>
<blockquote>
<p style="text-align: justify;"><span style="font-size: medium; font-family: georgia, palatino;">It is tricky to match the words, when they have arbitrary number characters ( that means some of the characters repetitive for one or more number of times.</span></p>
</blockquote>
<p style="text-align: justify;"> </p>
<h3 style="text-align: justify;"><span style="font-size: medium; line-height: 19px; font-family: georgia, palatino;">Step 7 :  Understand how to retrieve data conditionally.                                                                 </span></h3>
<h3 style="text-align: justify;"><a href="http://gurkulindia.com/main/lesson/grep-regex-lesson7" target="_blank"><span style="font-size: medium; color: #ff0000;"><strong>Try Now</strong></span></a></h3>
<h3 style="text-align: justify;"> </h3>
<blockquote>
<p style="text-align: justify;"><span style="font-size: medium; font-family: georgia, palatino;">So far whatever we understand is finding the words either matching or excluding specific characters. Sometime we might require to match the lines using group of words, in such cases RegEx goes well with the logical operators.</span></p>
</blockquote>
<p style="text-align: justify;"> </p>
<h3 style="text-align: justify;"><span style="font-size: medium; font-family: georgia, palatino;">Step 8 :  Understand how to match the words with optional characters                                     </span></h3>
<h3 style="text-align: justify;"><a href="http://gurkulindia.com/main/lesson/grep-regex-lesson8" target="_blank"><strong><span style="color: #ff0000;">Try Now</span></strong></a></h3>
<h3 style="text-align: justify;"> </h3>
<blockquote>
<p style="text-align: justify;"><span style="font-size: medium; font-family: georgia, palatino;">In Step 6 we learnt about matching words with the characters which are repeated one or more number of times, but it is often required to match the words which might be having optional characters ( i.e. zero or more number of times)</span></p>
</blockquote>
<p style="text-align: justify;"> </p>
<h3 style="text-align: justify;"><span style="font-size: medium; line-height: 19px; font-family: georgia, palatino;">Step 9 :  Understand how to deal with the white spaces.                                                             </span></h3>
<h3 style="text-align: justify;"><a href="http://gurkulindia.com/main/lesson/grep-regex-lesson9/" target="_blank"><span style="color: #ff0000;"><strong>Try Now</strong></span></a></h3>
<h3 style="text-align: justify;"> </h3>
<blockquote>
<p style="text-align: justify;"><span style="font-family: georgia, palatino; font-size: medium;">When dealing with real-world input, such as log files and even user input, it&#8217;s difficult not to encounter white spaces  We use it to format pieces of information to make it to read and scan visually, and a single space can change the entire output that we are looking for.</span></p>
</blockquote>
<p style="text-align: justify;"> </p>
<h3 style="text-align: justify;"><span style="font-size: medium; line-height: 19px; font-family: georgia, palatino;">Step 10 : Understand how to match the lines with specific characters either at the starting or the ending.    </span></h3>
<h3 style="text-align: justify;"><a href="http://gurkulindia.com/main/lesson/grep-regex-lesson10" target="_blank"><span style="color: #ff0000;"><strong>Try Now</strong></span></a></h3>
<h3 style="text-align: justify;"> </h3>
<blockquote>
<p style="text-align: justify;"><span style="font-size: medium; font-family: georgia, palatino;">Sometimes it is not desirable to match the words/patterns from any where of the text, instead we want to search the patterns only either beginning or ending of the each line. </span></p>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://gurkulindia.com/main/2013/05/virtual-lab-get-your-hands-dirty-with-grep-regex/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
