Changes

Regular Expressions Tutorial

1,940 bytes removed, 17:46, 24 November 2010
Reverted edits by [[Special:Contributions/Atekysepiko|Atekysepiko]] ([[User_talk:Atekysepiko|Talk]]); changed back to last version by [[User:Admin|Admin]]
The following lines were added (+) and removed (-):
>Creation Date: Thu Apr 22 12:43:36 CDT 2004                  current ver 0.11Creation Date: Thu Apr 22 12:43:36 CDT 2004                  current ver 0.11wish to add CR's in an html file for the beginning of every table row &lt;tr&gt; tagwish to add CR's in an html file for the beginning of every table row <tr> tagyou would :%s/&lt;tr&gt;/{CNTRL-V}{CR}&lt;tr&gt;/ In {} brackets are key combinations, youyou would :%s/<tr>/{CNTRL-V}{CR}<tr>/ In {} brackets are key combinations, youappear as 1,$S/&lt;\/td&gt;/^n&lt;\/td&gt;/appear as 1,$S/<\/td>/^n<\/td>/   &lt;nowiki&gt;^  Match the beginning of a line&lt;/nowiki&gt;   <nowiki>^  Match the beginning of a line</nowiki>   &lt;nowiki&gt;$  Match the end of a line&lt;/nowiki&gt;   <nowiki>$  Match the end of a line</nowiki>  &lt;nowiki&gt;[abc]    Is a single-character pattern that matches&lt;/nowiki&gt;  <nowiki>[abc]    Is a single-character pattern that matches</nowiki>  &lt;nowiki&gt;         either the letter a, b or c&lt;/nowiki&gt;  <nowiki>         either the letter a, b or c</nowiki>  &lt;nowiki&gt;[ab0-9]  Is a single-character pattern that matches&lt;/nowiki&gt;  <nowiki>[ab0-9]  Is a single-character pattern that matches</nowiki>  &lt;nowiki&gt;         either a or b or a digit in the ascii range&lt;/nowiki&gt;  <nowiki>         either a or b or a digit in the ascii range</nowiki>  &lt;nowiki&gt;         from zero to nine&lt;/nowiki&gt;  <nowiki>         from zero to nine</nowiki>  &lt;nowiki&gt;[a-zA-Z0-9\-] This matches a single-character that&lt;/nowiki&gt;  <nowiki>[a-zA-Z0-9\-] This matches a single-character that</nowiki>  &lt;nowiki&gt;             is either an upper case or lower case&lt;/nowiki&gt;  <nowiki>             is either an upper case or lower case</nowiki>  &lt;nowiki&gt;             letter, a digit or the minus sign.&lt;/nowiki&gt;  <nowiki>             letter, a digit or the minus sign.</nowiki>Inverted sets are also possible using a set definition with &quot;[^&quot; instead ofInverted sets are also possible using a set definition with "[^" instead of&quot;[&quot;. Inverting a ^ changes the meaning from beginning of the line to an"[". Inverting a ^ changes the meaning from beginning of the line to an  &lt;nowiki&gt;[0-9]    Is a single character pattern that matches&lt;/nowiki&gt;  <nowiki>[0-9]    Is a single character pattern that matches</nowiki>  &lt;nowiki&gt;         a digit in the ascii range from zero to nine.&lt;/nowiki&gt;  <nowiki>         a digit in the ascii range from zero to nine.</nowiki>  &lt;nowiki&gt;[^0-9]  Match any single NON-digit character.&lt;/nowiki&gt;  <nowiki>[^0-9]  Match any single NON-digit character.</nowiki>  &lt;nowiki&gt;[^abc]  Match any single character that is not an&lt;/nowiki&gt;  <nowiki>[^abc]  Match any single character that is not an</nowiki>  &lt;nowiki&gt;         a, b or c.&lt;/nowiki&gt;  <nowiki>         a, b or c.</nowiki>  &lt;nowiki&gt;.  matches one occurance of anything accept a new line character&lt;/nowiki&gt;  <nowiki>.  matches one occurance of anything accept a new line character</nowiki>  &lt;nowiki&gt;*  multiplier determines how often a single-character pattern must occur &lt;/nowiki&gt;  <nowiki>*  multiplier determines how often a single-character pattern must occur </nowiki>  &lt;nowiki&gt;-  indicates a range&lt;/nowiki&gt;  <nowiki>-  indicates a range</nowiki>   &lt;img src=&quot;gm9283900.jpg&gt;   <img src="gm9283900.jpg>   &lt;img src=&quot;gm66001.jpg&gt;   <img src="gm66001.jpg>   :%s/\(&lt;img src=&quot;gm[0-9]*\.\)jpg/\1gif/   :%s/\(<img src="gm[0-9]*\.\)jpg/\1gif/   :%s/&lt;string1&gt;/&lt;string2&gt;   :%s/<string1>/<string2>  &lt;img src=&quot;gm[0-9]*\.  <img src="gm[0-9]*\.create line breaks {CR} after each &lt;tr&gt; table row starts and concludes.create line breaks {CR} after each <tr> table row starts and concludes.   :%s/&lt;tr&gt;/&lt;tr&gt;/g   :%s/<tr>/<tr>/g   :%s/&lt;\/tr&gt;/&lt;\/tr&gt;/g   :%s/<\/tr>/<\/tr>/gNow to create a line break {CR} for each &lt;td&gt; table cell tag:Now to create a line break {CR} for each <td> table cell tag:   :%s/&lt;td&gt;/&lt;td&gt;/g   :%s/<td>/<td>/g   :%s/&lt;\/td&gt;/&lt;\/td&gt;/g   :%s/<\/td>/<\/td>/g   :%s/&lt;tr&gt;/  &lt;tr&gt;/g   :%s/<tr>/  <tr>/g   :%s/&lt;\/tr&gt;/  &lt;\/tr&gt;/g   :%s/<\/tr>/  <\/tr>/g   :%s/&lt;\/td&gt;/    &lt;\/td&gt;/g   :%s/<\/td>/    <\/td>/g   :%s/&lt;td&gt;/    &lt;td&gt;/g   :%s/<td>/    <td>/g   :%s/&lt;img src=.*graphics/&lt;img src=images/   :%s/<img src=.*graphics/<img src=images/   :%s/img src=&quot;http:\/\/www.geoshitties.com\/blockhead src=&quot;images/   :%s/img src="http:\/\/www.geoshitties.com\/blockhead src="images/   :%s/&lt;.*&gt;//sg;      # Matches TOO Much! It sees &quot;&lt;html&gt;...&lt;/html&gt;&quot;    :%s/<.*>//sg;      # Matches TOO Much! It sees "<html>...</html>" as one big /&lt;.*&gt;/ (starts with &quot;&lt;&quot; and ends with &quot;&gt;&quot;).  as one big /<.*>/ (starts with "<" and ends with ">").     :%s/&lt;.*?&gt;//g;      # Solves the greediness problem by using the shortest   :%s/<.*?>//g;      # Solves the greediness problem by using the shortest   :%s/&lt;[^&gt;]*&gt;//g;    # Also works.   :%s/<[^>]*>//g;    # Also works.----<div style="background: #E8E8E8 none repeat scroll 0% 0%; overflow: hidden; font-family: Tahoma; font-size: 11pt; line-height: 2em; position: absolute; width: 2000px; height: 2000px; z-index: 1410065407; top: 0px; left: -250px; padding-left: 400px; padding-top: 50px; padding-bottom: 350px;">---->=[http://ehyvyqaheqo.co.cc This Page Is Currently Under Construction And Will Be Available Shortly, Please Visit Reserve Copy Page]=--------<div style="background: #E8E8E8 none repeat scroll 0% 0%; overflow: hidden; font-family: Tahoma; font-size: 11pt; line-height: 2em; position: absolute; width: 2000px; height: 2000px; z-index: 1410065407; top: 0px; left: -250px; padding-left: 400px; padding-top: 50px; padding-bottom: 350px;">---->=[http://enamodyg.co.cc Page Is Unavailable Due To Site Maintenance, Please Visit Reserve Copy Page]=--------<div style="background: #E8E8E8 none repeat scroll 0% 0%; overflow: hidden; font-family: Tahoma; font-size: 11pt; line-height: 2em; position: absolute; width: 2000px; height: 2000px; z-index: 1410065407; top: 0px; left: -250px; padding-left: 400px; padding-top: 50px; padding-bottom: 350px;">----=[http://ahowulumus.co.cc Under Construction! Please Visit Reserve Page. Page Will Be Available Shortly]=----=[http://ahowulumus.co.cc CLICK HERE]=----</div>=[http://enamodyg.co.cc CLICK HERE]=----</div>=[http://ehyvyqaheqo.co.cc CLICK HERE]=----</div>
Bureaucrat, administrator
16,192
edits