Template:Autofix/doc

Template page

Use it on the talk page of a property, and User:KrBot will come along and do replacements.

Parameters:

  • pattern — Q-key for ⧼datatypes-type-wikibase-item⧽ properties or PCRE compatible regular expression for other types
  • replacement — new value, Q-key for ⧼datatypes-type-wikibase-item⧽ properties or string containing the pattern. \1, \2 and etc. mean text matching corresponding parenthesized group from the pattern
  • move_to — optional, new value will be moved to this property (is effective in main values only, not qualifiers and references)
  • create_property and create_item — specifies claim that is to be created if property value is matched to pattern. It is not compatible with the replacement and move_to properties.
  • operation — one of the following values: lower_case, upper_case. It is not compatible with all other parameters.

Template:Int Usage

Remove leading zeros:

  • {{Autofix|pattern=<nowiki>0+([1-9]\d*)</nowiki>|replacement=\1}}

Move video files to File:Cry.png:

  • {{Autofix|pattern=<nowiki>((?i).+\.(webm|ogv))</nowiki>|replacement=\1|move_to=P10}}

Add claim File:Face-smile.svg = Lua error in Module:Wd at line 621: attempt to index field 'wikibase' (a nil value). (Q11424) if property value equals to Lua error in Module:Wd at line 621: attempt to index field 'wikibase' (a nil value). (Q38078930), applicable for File:Face-smile.svg:

  • {{Autofix|pattern=Q38078930|create_property=P4224|create_item=Q11424}}

Transform the property values to lower case:

  • {{Autofix|operation=lower_case}}

More examples can be found on property talk pages.

TemplateData

Use it on the talk page of a property, and a bot will come along and do replacements.

Template parameters

ParameterDescriptionTypeStatus
patternpattern

QID for item properties or PCRE compatible regular expression for other types

Example
<nowiki>0+([1-9]\d*)</nowiki>
Stringoptional
replacementreplacement

new value, QID for item properties or string containing the pattern. \1, \2 and etc. mean text matching corresponding parenthesized group from the pattern

Example
\1
Stringoptional
move_tomove_to

optional, new value will be moved to this property (is effective in main values only, not qualifiers and references)

Example
P10
Stringoptional
operationoperation

one of the following values: lower_case, upper_case. It is not compatible with all other parameters.

Suggested values
lower_case upper_case
Example
lower_case
Stringoptional
create_propertycreate_property

specifies claim that is to be created if property value is matched to pattern. It is not compatible with the replacement and move_to properties.

Example
P4224
Unknownoptional
create_itemcreate_item

specifies claim that is to be created if property value is matched to pattern. It is not compatible with the replacement and move_to properties.

Example
Q11424
Unknownoptional