Difference between revisions of "User:Megavolt/regex"
From Manjaro
Views
Actions
Namespaces
Variants
Tools
m (">" to "<") |
m (added "remove misc" and "prepare categories") |
||
Line 9: | Line 9: | ||
|- | |- | ||
| rowspan="2"|Add "Special:MyLanguage" to internal links | | rowspan="2"|Add "Special:MyLanguage" to internal links | ||
| <nowiki>(?!\[\[(C|c)ategory:|\[\[(F|f)ile:|\[\[(I|i)mage:|\[\[(S|s)pecial:MyLanguage/)\[\[([A-Za-z0-9 '+-_]+)\]\]</nowiki> | | <nowiki>(?!\[\[(C|c)ategory:|\[\[(F|f)ile:|\[\[(I|i)mage:|\[\[(S|s)pecial:MyLanguage/)\[\[([A-Za-z0-9 '+-_#]+)\]\]</nowiki> | ||
| <nowiki>[[Special:MyLanguage/$ | | <nowiki>[[Special:MyLanguage/$5|<translate>$5</translate>]]</nowiki> | ||
|- | |- | ||
| <nowiki>(?!\[\[(C|c)ategory:|\[\[(F|f)ile:|\[\[(I|i)mage:|\[\[(S|s)pecial:MyLanguage/)\[\[([A-Za-z0-9 '+-_]+)\|([A-Za-z0-9 '+-_]+)\]\]</nowiki> | | <nowiki>(?!\[\[(C|c)ategory:|\[\[(F|f)ile:|\[\[(I|i)mage:|\[\[(S|s)pecial:MyLanguage/)\[\[([A-Za-z0-9 '+-_#]+)\|([A-Za-z0-9 '+-_#]+)\]\]</nowiki> | ||
| <nowiki>[[Special:MyLanguage/$5|<translate>$6</translate>]]</nowiki> | | <nowiki>[[Special:MyLanguage/$5|<translate>$6</translate>]]</nowiki> | ||
|- | |||
| Remove misc tags of the translate extension | |||
| <nowiki><!--T:\d+--></nowiki><br /><nowiki><(/|)translate></nowiki> | |||
| | |||
|- | |||
| rowspan="2" | prepare categories | |||
| <nowiki>\[\[(:(C|c)ategory:([A-Za-z0-9 '+-_#]+))\]\]</nowiki> | |||
| <nowiki>[[$3{{#translation:}}|<translate>$3</translate>]]</nowiki> | |||
|- | |||
| <nowiki>\[\[(:(C|c)ategory:([A-Za-z0-9 '+-_#]+)\|([A-Za-z0-9 '+-_#]+))\]\]</nowiki> | |||
| <nowiki>[[$3{{#translation:}}|<translate>$4</translate>]]</nowiki> | |||
|} | |} |
Revision as of 10:04, 29 March 2021
Here i will add a list of regex commands for daily usage for remembering.
description | Search | Replace |
---|---|---|
Add "Special:MyLanguage" to internal links | (?!\[\[(C|c)ategory:|\[\[(F|f)ile:|\[\[(I|i)mage:|\[\[(S|s)pecial:MyLanguage/)\[\[([A-Za-z0-9 '+-_#]+)\]\] | [[Special:MyLanguage/$5|<translate>$5</translate>]] |
(?!\[\[(C|c)ategory:|\[\[(F|f)ile:|\[\[(I|i)mage:|\[\[(S|s)pecial:MyLanguage/)\[\[([A-Za-z0-9 '+-_#]+)\|([A-Za-z0-9 '+-_#]+)\]\] | [[Special:MyLanguage/$5|<translate>$6</translate>]] | |
Remove misc tags of the translate extension | <!--T:\d+--> <(/|)translate> |
|
prepare categories | \[\[(:(C|c)ategory:([A-Za-z0-9 '+-_#]+))\]\] | [[$3{{#translation:}}|<translate>$3</translate>]] |
\[\[(:(C|c)ategory:([A-Za-z0-9 '+-_#]+)\|([A-Za-z0-9 '+-_#]+))\]\] | [[$3{{#translation:}}|<translate>$4</translate>]] |