Template:Autofix

Pattern ^{{{pattern}}}$ will be automatically replaced to {{{replacement}}}.
Testing:
Documentation icon Template documentation[view · edit · history · purge ]

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

Parameters:

  • pattern — Q-key for Item properties or PCRE compatible regular expression for other types
  • replacement — new value, Q-key for Item properties or string containing \1, \2 and etc. mean text matching corresponding parenthesized group from the pattern
  • move_to — optional, new value will be moved to this property
  • create_property and create_item — specifies claim that is need to be created if property value is matched to pattern. Is not compatible with replacement and move_to properties.
  • operation — one of the following values: lower_case, upper_case. Is not compatible with all other parameters.

UsageEdit

Remove leading zeros:

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

Move video files to video (P10):

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

Add claim category contains (P4224) = film (Q11424) if property value equals to film, by year of publication only (Q38078930), applicable for category combines topics (P971):

  • {{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.

See alsoEdit