Jump to content

Wikipedia:AutoWikiBrowser/Find and replace

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Makyen (talk | contribs) at 03:35, 16 March 2014 (Undid revision 599728695 by Rjwilmsi (talk) The added information was inaccurate. \n is only interpreted as a newline within regular expressions.). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
Chapters: Core · Database scanner · Find and replace · Regular expressions · General fixes
Show example screen shot

Normal

Show example screen shot

Find and replace

  • Ignore external/Interwiki links, images, nowiki, math, <!-- --> – If checked AWB will mask these items so that find & replace entries are not applied to them. Calls HideText.Hide() – see Hide documentation.
  • Ignore templates, refs, link targets, and headings – If checked AWB will mask the items above plus these items and quotes between quotation marks (all the most common ones) so that find & replace entries are not applied to them. Calls HideText.HideMore() – see HideMore documentation.
  • Add replacements to edit summary – If checked AWB will add the replacements made to the edit summary - up to a certain length of text (255 bytes). Take care with this when working with wikimarkup characters that would make the edit summary invalid.
  • Search: – Enter a search criterion in search box.
  • Go – Will search for what was entered in the search box.
  • Clear – Clears all the rules.
  • Done – Exit Find and replace
Find – Expression to find. Also uses the keywords below.
Replace with – Text to be replaced. Special fields include:
$1, $2 etc. if the "find" expression is a regular expression and regex is ticked will use the values from "Find"
Each pair of brackets in a regular expression corresponds to a string, so if you searched for (123)4(56)78, $1 would correspond to 123 and $2 would correspond to 56
AWB keywords will be replaced with their values as in the following examples. These keywords also work for Advanced.
keyword value for
Albert Einstein
value for
Wikipedia:AutoWikiBrowser/Find and replace
%%key%%
(human name sort key)
Einstein, Albert Replace, Autowikibrowser/Find And
%%title%% Albert Einstein Wikipedia:AutoWikiBrowser/Find and replace
%%fullpagename%% Albert Einstein Wikipedia:AutoWikiBrowser/Find and replace
%%pagename%% Albert Einstein AutoWikiBrowser/Find and replace
%%subpagename%% Albert Einstein Find and replace
%%basepagename%% Albert Einstein AutoWikiBrowser
%%namespace%% Wikipedia
%%server%% http://en.wikipedia.org http://en.wikipedia.org
%%servername%% en.wikipedia.org en.wikipedia.org
%%scriptpath%% /w /w
- Carriage return. This part of the AWB manual needs help in explaining its function. If you know how this function works, please feel free to edit.
Case Sensitive – If checked the search is case sensitive.
Regex – If checked indicates that the find expression is a regular expression.
Multiline – If checked, this indicates to AWB that the regex characters "^" and "$" ought to match at the beginning and the end of lines respectively, not just the beginning and end of a whole string.
Singleline – If checked, this indicates to AWB that the regex character "." matches every character. Instead of every character except "\n".
Minor – If checked AWB will mark this rule as minor. By using "Skip if only minor fixes" AWB can skip if the set of F&R rules contains only minor ones.
After fixes – If checked AWB will apply this rules after all other rules (general fixes, typos etc.). Otherwise It will apply this rule before all other rules.
Enabled – If checked indicates that this rule is active. If not checked then this rule will be ignored by AWB.

Advanced

Show example screen shot

This area allows you to set special search and replace criteria for AWB. This can be in the form of regular text searches or regular expression text searches.

  • Main Menus
  • New – Allows you to select Rules or Subrules. See Types of rules below.
  • Rule – Various edit commands. Undo, Redo, Cut, Copy, Paste, Delete and Refresh colours

  • Types of rules
  • Rule each one of these can be nested so that if the upper most rule is satified then AWB will process the next rule below.
Find and replace
In template call
Template parameter – Regular rules, AWB will be process these rules (if enabled) against the text of a page.
  • In Template Call Rule – These rules will only be processed if within a template.
  • Template Parameter Rule – These rules allow you to change template parameter names.
  • Subrule
  • Rule – Same as a regular rule, but only acted upon if the regular rule is acted upon.
  • In Template Call Rule – Same as a regular in template call rule, but only acted upon if the regular in template call rule is acted upon.
  • Template Parameter Rule – Same as a regular template parameter rule, but only acted upon if the regular template parameter rule is acted upon.

  • Name – This allows you to name your rule so that you can recognize it.
  • Enabled – If checked the rule is enabled. If unchecked this rule will be ignored by AWB. Unchecked rules will be highlighted in red in the list of rules.
  • Type
  • Entire text – lets you search with the entire text string.
  • Inside template calls {{..}} – specifies only search within a template.
  • Find – In this section you enter your search criteria. If you check the Regular expression box on the bottom of the page, the criteria you enter here will be acted on as it is a regular expression. Otherwise it will be searched as it were regular text case insensitive.
  • Replace with: – The criteria you place in this box will be replaced with what was found in the Find section.
  • Regular expression – If checked indicates to AWB that the find criteria is a regular expression.
  • Case sensitive – If checked indicates to AWB that the find criteria is case sensitive.
  • Multiline – If checked, this indicates to AWB that the regex characters "^" and "&" so that they match at the beginning and the end of lines respectively, not just the beginning and end of a whole string.
  • Single line – If checked, this indicates to AWB that the regex character "." matches every character. Instead of every character except "\n".
  • Apply # times – Used for unusual circumstances when it is useful to instruct AWB to iteratively apply the transformation more than once to the same line.
  • If
  • Contains – The page would be checked for the inserted text. If it contains it, AWB would apply the find and replace rule which is defined in the other "Find" tab.
  • Not Contains – The page would be checked for the inserted text. If it doesn't contains it, AWB would apply the find and replace rule which is defined in the other "Find" tab.
  • Regular expression – If checked indicates to AWB that the find criteria is a regular expression.
  • Case sensitive – If checked indicates to AWB that the find criteria is case sensitive.
  • Multiline – If checked, this indicates to AWB that the regex characters "^" and "&" so that they match at the beginning and the end of lines respectively, not just the beginning and end of a whole string.
  • Single line – If checked, this indicates to AWB that the regex character "." matches every character. Instead of every character except "\n".

Template substitution

Show example screen shot

Note the section needs expert attention. If you know how this section works, please feel free to edit it.

  • Templates to substitute: List of templates to substitute. {{Test1}} or Template:Test1 (each on a new line)
No requirement for curly brackets around template name, simply the name is sufficient. Note that template will be substituted upon being viewed in "diff".
  • Ignore external/interwiki links, images, nowiki, math and <!-- --> – If checked AWB will mask these items so that find & replace entries are not applied to them. Calls HideText.Hide() – see Hide documentation.
  • Expand recursively If template is a redirect, get the subst'd of its target and replaces with that
  • Include comment with template Includes a comment with the template name - <!-- Template:Test -->
  • Clear Clears the contents of the "Templates to substitute box"
  • Reset Sets the Template list back to whatever was entered when ok was last pressed
  • OK Commits the lines to be used for reset. Closes the window
  • Cancel Cancel and close the window
  • It is unnecessary to use this feature to substitute the templates listed here, which will be automatically substituted if "General fixes" is turned on.

Saving and restoring find-and-replace specifications

The values you specify in the Find and replace entries are saved when you use the "Save settings" command under the "File" menu (along with other settings). The current entries are erased and the saved ones are restored when you use the "Open settings..." or "Recent settings..." commands.

There is no way to import new Find and replace entries other than directly editing a "settings" file of the kind generated by the "Save settings" command (and then opening it as a settings file). This file is in XML format and so appears as editable text if opened in a text editor.

A list of user contributed settings is available.