Main Page

Difference between revisions of "User:Electrolytes/Regex Semi-autocovert"

From Arks-Visiphone
Jump to navigation Jump to search
(Created page with "Notepad++, weapons page regex semi-auto generate test Using this with CR/LF on first: http://www.odditysoftware.com/page-webtools16.htm Find: <pre> <tr>.*?class=\"([\w]*)\"...")
 
m
 
(9 intermediate revisions by the same user not shown)
Line 9: Line 9:
 
Replace:
 
Replace:
 
<pre>
 
<pre>
<\!--Rarity-->\|\{\{\:$2Star\}\}\r\n<\!--Icon-->\|\[\[Image\:$5\.png\]\]\r\n<\!--Name-->\|\[\[$5\]\]<br>$4\r\n<\!--Requirement-->\|$6 $7\r\n<\!--Stat-->\|\[\[Image\:small_s-atk\.png\]\] <br>[\[Image\:small_r-atk\.png\]\] <br>[\[Image\:small_t-atk\.png\]\]\r\n<\!--Base\(S-Atk\, R-Atk\, T-Atk\)-->\|$8<br>$9<br>$10\r\n<\!--\+10-->\|$38<br>$39<br>$40\r\n<\!--Properties-->\|$42\r\n<\!--Classes-->\|$43\r\n\|-\r\n<noinclude>\r\n\[\[Category\:DataSwords\]\]\r\n\[\[Category\:Data\]\]\r\n<\/noinclude>\r\n\r\n
+
<\!--Rarity-->\|\{\{\:$2Star\}\}\r\n<\!--Icon-->\|\[\[File\:$5\Icon.png\]\]\r\n<\!--Name-->\|\[\[$5\]\]<br>$4\r\n<\!--Requirement-->\|$6 $7\r\n<\!--Stat-->\|\[\[File\:small_s-atk\.png\]\] <br>[\[File\:small_r-atk\.png\]\] <br>[\[File\:small_t-atk\.png\]\]\r\n<\!--Base\(S-Atk\, R-Atk\, T-Atk\)-->\|$8<br>$9<br>$10\r\n<\!--\+10-->\|$38<br>$39<br>$40\r\n<\!--Properties-->\|$42\r\n<\!--Classes-->\|$43\r\n\|-\r\n<noinclude>\r\n\[\[Category\:DataSwords\]\]\r\n\[\[Category\:Data\]\]\r\n<\/noinclude>\r\n\r\n
 +
</pre>
 +
Replace (alternate/noncategory):
 +
<pre>
 +
<\!--Rarity-->\|\{\{\:$2Star\}\}\r\n<\!--Icon-->\|\[\[File\:$5\Icon.png\]\]\r\n<\!--Name-->\|\[\[$5\]\]<br>$4\r\n<\!--Requirement-->\|$6 $7\r\n<\!--Stat-->\|\[\[File\:small_s-atk\.png\]\] <br>[\[File\:small_r-atk\.png\]\] <br>[\[File\:small_t-atk\.png\]\]\r\n<\!--Base\(S-Atk\, R-Atk\, T-Atk\)-->\|$8<br>$9<br>$10\r\n<\!--\+10-->\|$38<br>$39<br>$40\r\n<\!--Properties-->\|$42\r\n<\!--Classes-->\|$43\r\n\|-\r\n
 
</pre>
 
</pre>
 
Find:
 
Find:
Line 17: Line 21:
 
Replace:
 
Replace:
 
<pre>
 
<pre>
\[\[Image\:$1\.png\]\] $2
+
\[\[File\:$1\.png\]\] $2
 
</pre>
 
</pre>
 
Find:
 
Find:
Line 25: Line 29:
 
Replace:
 
Replace:
 
<pre>
 
<pre>
\[\[Image\:Ability\.png\]\] \{\{abbr\|$2\|$1\}\}
+
\{\{props\|$2\}\}
 
</pre>
 
</pre>
 
Find:
 
Find:
Line 41: Line 45:
 
Replace:
 
Replace:
 
<pre>
 
<pre>
\[\[Image\:Photon Art\.png\]\] \{\{abbr\|$2\|$1\}\}
+
\[\[File\:Photon Art\.png\]\] \{\{abbr\|$2\|$1\}\}
 +
</pre>
 +
Find:
 +
<pre>
 +
<img.*?title=\"Technique\".*?title=\"([^\"]*)\"> ([^<]*).*?>
 +
</pre>
 +
Replace:
 +
<pre>
 +
\[\[File\:Photon Art\.png\]\] \{\{abbr\|$2\|$1\}\}
 
</pre>
 
</pre>
 
Find:
 
Find:
Line 49: Line 61:
 
Replace:
 
Replace:
 
<pre>
 
<pre>
\[\[Image\:$2Icon\.png\|$1\]\]
+
\[\[File\:$2Icon\.png\|$1\]\]
 
</pre>
 
</pre>
 
Find:
 
Find:
Line 63: Line 75:
 
<tr class=\"head.*?\/tr>
 
<tr class=\"head.*?\/tr>
 
</pre>
 
</pre>
 
+
Remove:
 +
<pre>
 +
<tr class=\"craft.*?\/tr>
 +
</pre>
 +
Find:
 +
<pre>
 +
(Icon-->.*?)[ \/]
 +
</pre>
 +
Replace (recursive until 0 matches):
 +
<pre>
 +
$1
 +
</pre>
  
 
'''For generating page links:'''
 
'''For generating page links:'''
Line 69: Line 92:
 
Find:
 
Find:
 
<pre>
 
<pre>
<\!--Icon-->.*?Image\:(.*)\.png\]\]
+
<\!--Icon-->.*?File\:(.*)\.png\]\]
 
</pre>
 
</pre>
 
Replace:
 
Replace:

Latest revision as of 17:19, 22 January 2016

Notepad++, weapons page regex semi-auto generate test

Using this with CR/LF on first: http://www.odditysoftware.com/page-webtools16.htm

Find:

<tr>.*?class=\"([\w]*)\">(\d*)★.*?rel=\"(\w*)\".*?all\(this\)..([^<]*).*?title.*?>([^<]*).*?<td>([\d]*)....([-\w]*).*?<td>.*?<td>(\d*)<[br\/]*>(\d*)<[br\/]*>(\d*)<td>(\d*)<[br\/]*>(\d*)<[br\/]*>(\d*)<td>(\d*)<[br\/]*>(\d*)<[br\/]*>(\d*)<td>(\d*)<[br\/]*>(\d*)<[br\/]*>(\d*)<td>(\d*)<[br\/]*>(\d*)<[br\/]*>(\d*)<td>(\d*)<[br\/]*>(\d*)<[br\/]*>(\d*)<td>(\d*)<[br\/]*>(\d*)<[br\/]*>(\d*)<td>(\d*)<[br\/]*>(\d*)<[br\/]*>(\d*)<td>(\d*)<[br\/]*>(\d*)<[br\/]*>(\d*)<td>(\d*)<[br\/]*>(\d*)<[br\/]*>(\d*)<td>(\d*)<[br\/]*>(\d*)<[br\/]*>(\d*)<td>(.*?)<td.*?>(.*?)<td.*?>(.*?)<td.*?>(.*?)<\/tr>

Replace:

<\!--Rarity-->\|\{\{\:$2Star\}\}\r\n<\!--Icon-->\|\[\[File\:$5\Icon.png\]\]\r\n<\!--Name-->\|\[\[$5\]\]<br>$4\r\n<\!--Requirement-->\|$6 $7\r\n<\!--Stat-->\|\[\[File\:small_s-atk\.png\]\] <br>[\[File\:small_r-atk\.png\]\] <br>[\[File\:small_t-atk\.png\]\]\r\n<\!--Base\(S-Atk\, R-Atk\, T-Atk\)-->\|$8<br>$9<br>$10\r\n<\!--\+10-->\|$38<br>$39<br>$40\r\n<\!--Properties-->\|$42\r\n<\!--Classes-->\|$43\r\n\|-\r\n<noinclude>\r\n\[\[Category\:DataSwords\]\]\r\n\[\[Category\:Data\]\]\r\n<\/noinclude>\r\n\r\n

Replace (alternate/noncategory):

<\!--Rarity-->\|\{\{\:$2Star\}\}\r\n<\!--Icon-->\|\[\[File\:$5\Icon.png\]\]\r\n<\!--Name-->\|\[\[$5\]\]<br>$4\r\n<\!--Requirement-->\|$6 $7\r\n<\!--Stat-->\|\[\[File\:small_s-atk\.png\]\] <br>[\[File\:small_r-atk\.png\]\] <br>[\[File\:small_t-atk\.png\]\]\r\n<\!--Base\(S-Atk\, R-Atk\, T-Atk\)-->\|$8<br>$9<br>$10\r\n<\!--\+10-->\|$38<br>$39<br>$40\r\n<\!--Properties-->\|$42\r\n<\!--Classes-->\|$43\r\n\|-\r\n

Find:

<img.*?attribute.*?title=\"(\w*)[^\d]*(\d*)

Replace:

\[\[File\:$1\.png\]\] $2

Find:

<img.*?title=\"Ability\".*?title=\"([^\"]*)\"> ([^<]*).*?>

Replace:

\{\{props\|$2\}\}

Find:

<img.*?title=\"Potential\".*?title=\"([^\"]*)\"> ([^<]*).*?>

Replace:

\{\{pots\|$2\}\}

Find:

<img.*?title=\"Photon Art\".*?title=\"([^\"]*)\"> ([^<]*).*?>

Replace:

\[\[File\:Photon Art\.png\]\] \{\{abbr\|$2\|$1\}\}

Find:

<img.*?title=\"Technique\".*?title=\"([^\"]*)\"> ([^<]*).*?>

Replace:

\[\[File\:Photon Art\.png\]\] \{\{abbr\|$2\|$1\}\}

Find:

<img.*?class_.*?title=\"((\w\w)\w*)..>

Replace:

\[\[File\:$2Icon\.png\|$1\]\]

Find:

<img.*?title=\"All Class\".>

Replace:

\[\[File:HuIcon.png\|Hunter\]\]\[\[File:FiIcon.png\|Fighter\]\]\[\[File:RaIcon.png\|Ranger\]\]\[\[File:GuIcon.png\|Gunner\]\]\[\[File:FoIcon.png\|Force\]\]\[\[File:TeIcon.png\|Techer\]\]\[\[File:BrIcon.png\|Braver\]\]\[\[File:BoIcon.png\|Bouncer\]\]

Remove:

<tr class=\"head.*?\/tr>

Remove:

<tr class=\"craft.*?\/tr>

Find:

(Icon-->.*?)[ \/]

Replace (recursive until 0 matches):

$1

For generating page links:

Find:

<\!--Icon-->.*?File\:(.*)\.png\]\]

Replace:

http\:\/\/nanapedia-pso2\.shoutwiki\.com\/wiki\/Template\:SimpleData$1