Wikipedia talk:AutoWikiBrowser/Find and replace/Archive 1

RefList
Sorry, Rookie AWB Question: I noticed that AWB changes the "references/" to "reflist"...which is not always perferable...Are there parameters around this? Is it only when "reflist" has no parameters? I was hoping to find a bit more description of functions here...Like "what" gets replaced and "Why" (meaning which MOS or guildline it is trying to standardize...) -- Mjquin_id (talk) 18:14, 20 November 2008 (UTC)
 * It changes it in only certain criteria (dont ask me specifically what). There are some changes that have no appearance changes, but some, with certain div's round it, that would change it, and hence, AWB leaves alone. — Ree dy  18:22, 20 November 2008 (UTC)
 * AWB is changing "references/" to "reflist" only if there is div class small around it. This change doesn't affect the appearance of the references in the article. -- Magioladitis (talk) 18:28, 20 November 2008 (UTC)

How to replace in more than one line?
I can't understand how to replace in more than one line. For example, in article XXX, how do I replace: Line 1 Line 2 Line 3 with: Line 1 Line 3 Notice that I don't want an empty line like this: Line 1

Line 3 Thank you very much. --Tintero (talk) 18:49, 19 February 2009 (UTC)
 * Line 1\r\n --> "" — Ree dy  23:40, 19 February 2009 (UTC)
 * I had tried, but continues not working. Could you be more specific? Thanks, --Tintero (talk) 14:21, 20 February 2009 (UTC)
 * Replace "Line1\r\n" with "" (ie nothing) — Ree dy  14:41, 20 February 2009 (UTC)
 * What is wrong? And, I want to delete Line 2, do you mean that the line I want to delete depends on the previous one? Because it may vary. --Tintero (talk) 15:27, 20 February 2009 (UTC)
 * Ah, sorry. Duh. You want Line 2\r\n then. By "" i mean nothing, put nothing at all in the replacement box. Basically, you need to match the line break, so the \r\n matches the newline and the carriage return — Ree dy  19:46, 20 February 2009 (UTC)
 * T_T I had tried to activate and deactivate all options, and it didn't detect the text and apply the change. Maybe it's because I'm not using it on Wikipedia (Wikia). Thank you very much for your patience, --Tintero (talk) 00:10, 21 February 2009 (UTC)

Using it on wiki wouldn't be the problem. And you shouldnt need anything but enabled checked... — Ree dy  22:00, 21 February 2009 (UTC)


 * I thought \r\n were regular expressions so I suposed Regex should be checked. In any case I tried that before too. --Tintero (talk) 19:32, 22 February 2009 (UTC)

I only use \n. Rich Farmbrough, 11:10 2 March 2009 (UTC).


 * Thanks for all. I finally found the way to do it, using the advanced replace. Greetings, --Tintero (talk) 13:48, 2 March 2009 (UTC)

Do not replace text which is part of url?
I would like to replace .pdf on every page of our wiki with .pdf apart from when it is included in a URL - ie Example Cjchilling (talk) 08:14, 17 May 2009 (UTC)

Case change
Any way to change the case of a letter? Rocket000 (talk) 17:11, 5 January 2010 (UTC)

Missing explanation in Advanced section
It is said in the Advanced section of the Find and replace page: 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. As an AWB beginner using the Help page, I find that text ambiguous at best: does that text refer to Rules or to Subrules really? Say you create 2 Rules (not Subrules), what happens: are the rules independant OR are they additive OR are they mutually exclusive? I'm not sure that is explained in this document... --AlainR345Techno-Wiki-Geek 18:51, 8 May 2010 (UTC)
 * Hm... I would say they are independent and additive (if I catch your meaning). If the first rule is acted on, and the second rule then qualifies (because the first rule changed the text into something the second rule recognized), it will run as well. The nested refers to subrules.

Rule Subrule Subsubrule Subrule 2
 * In theory none of the subrules will act if "rule" doesn't, and Subsubrule will only act if Subrule does. – xeno talk  19:51, 8 May 2010 (UTC)

Change edit summary
The second question is about edit summaries.

Once I have done a regex replacement, say Don't -> Do not, the summary tab displays this.

If, however, I decide to cancel the operation, as it is in a quote etc., how do I remove the summary for "Don't -> Do not" or am I stuck with it? Chaosdruid (talk) 19:52, 3 February 2011 (UTC)
 * Edit it manually? (I think there's a tab for that, no?) – xeno talk 20:55, 3 February 2011 (UTC)
 * The only tab I can see is
 * Edit box|History|What links here|Edit Summary
 * It will not allow me to type into it or remove any of the info. Chaosdruid (talk) 21:21, 3 February 2011 (UTC)

character removal around a string
Hi

I am trying to set up a rule to replace a series of deboldening.

I have the ind param set up to detect the entries but cannot work out how to keep the "filling"

Find: \* ' ' ' (\S.*\S) ' ' '

Replace:

Text to search: * ' ' ' Harry ' ' ' played by

Result:... {* ' ' ' Harry ' ' '}
 * .... {* ' ' ' Harry ' ' '}
 * ....{Harry}
 * ....{Harry}
 * ....{Harry}

The find param works fine, however I cannot work out how to keep the removed text so that it is replaced correctly. If I put (\S.*\S) into the replace field all I get back is

Result:(\S.*\S)

Obviously either I am missing some way of giving the string a name to recall, or some other function. Chaosdruid (talk) 19:45, 3 February 2011 (UTC)
 * $1 maybe? – xeno talk 20:54, 3 February 2011 (UTC)
 * I am a silly bugger lol, sometimes it's the obvious things lmao - I kept trying to put $1 in the FInd as well as the Replace, but its just in the replace isnt it...
 * Yup, sure enough I need to put "Replace:* $1" and that returns it in full - thx for that :¬) Chaosdruid (talk) 21:28, 3 February 2011 (UTC)
 * Sometimes it takes another set of eyes to notice the blindingly obvious =) As for your question below, I'm afraid I don't have an answer for that ;p – xeno talk 21:30, 3 February 2011 (UTC)
 * (ec)
 * And now comes the hard? part - now that is working the problem is that every page has ' ' ' ' ' XXXXX ' ' ' ' ' in the opening few words and I need to exclude them, otherwise it will debolden and leave as italics.
 * Any ideas on that one ? Chaosdruid (talk) 21:32, 3 February 2011 (UTC)
 * It shouldn't match words in the lead because you have a preceding bullet point, no? – xeno talk 21:34, 3 February 2011 (UTC)
 * Sorry, I missed a step there! Following on from that I need to have a rule fo r those that do not have the preceeding *
 * For example, in the middle of text or as the first words of a paragraph.
 * ' ' 'Fred Bloggs' ' ' (Jim Tool) - The foil for ' ' ' Trevors ' ' ' comic antics
 * and the main proponent of misery in the gang.
 * That was the missing step - sry about that Chaosdruid (talk) 21:44, 3 February 2011 (UTC)
 * You could start the rule with  ==(.*?)  - so it would have to first match two equals signs, then a bunch of other stuff, and then the bolding. That should get you below the lead. Don't forget to replace the bunch of other stuff =]. – xeno''' <sup style="color:black;">talk 21:49, 3 February 2011 (UTC)

K- that is really weird...

Text to search: (always the same )

Harry is a film ==Blah== Harry played by fred Levi played by Ahmed


 * So the first way it only replaces the first one after the == (I assume because the rest are not preceded by ==) which gives:

Find:==(.*?) ' ' ' (\S*) ' ' '

Replace:==$1$2

Result:

Harry is a film

==Blah== Harry played by fred

Levi played by Ahmed


 * This next one works fine (apart from the first line) as it does a repetitive find and replace:

Find:' ' ' (\S*) ' ' '

Replace:$1

Result:

Harry is a film

==Blah== Harry played by fred

Levi played by Ahmed


 * I just need to work out how to make it ignore the first ' ' ' ' ' Harry ' ' ' ' ' is a film - ah well at least I can still use it, just cancel the first edit and then save, annoyingly though it will wstop at every page, even those that need nothing doing as every page has that first ' ' ' ' ' XXX ' ' ' ' '. Chaosdruid (talk) 23:11, 3 February 2011 (UTC)

Category replacement
I want to replace with. What to type in find and replace to do it? I'm a new user of AWB. 85.89.162.235 (talk) 09:39, 9 May 2011 (UTC)


 * You have to better use the category replacement instead of the find and replace.


 * Go to the "More..." tab. There is a box called "Categories". Choose a task... Replace category and put in the top box Obrazki and on the bottom Grafiki. -- Magioladitis (talk) 10:27, 9 May 2011 (UTC)

Year
Hi, I used AWB for a non-wikipedia project. I wish to find an replace all years.

Exemple : find and replace 1800 - 1801 - 1802 and so on and replace by the same without link : 1800 - 1801 - 1802 and so on.

How can I do ? --62.147.241.53 (talk) 17:20, 8 November 2011 (UTC)

Editing sentences
I need to useAWB to edit some images due to a template change, as such I'll need to wrap square brackets around images that previously didn't have them. As such I'm trying to do "image=image.png" -> "image= 128px " is there a way I can make find and replace only find this section as otherwise I may end up adding |128px]] to the end of .pngs on the page in places they shouldn't be as "image" is different on every page. 92.17.227.119 (talk) 18:59, 18 January 2013 (UTC)

Please show examples in the manual
Some examples would enhance the descriptions. Particularly some examples about the effect of the Multiline/Singleline options would be useful. Karmela (talk) 19:51, 15 March 2014 (UTC)

Help to replace
Hello. I want to remove a template. The templates has different names in it. For example:





I want to remove   to have only

TEAM1

TEAM2

TEAM3

I can easily remove with find and replace the  . Any suggestions?

Xaris333 (talk) 16:50, 12 April 2014 (UTC)


 * That would probably require a regular expression. Try the following:
 * <tt> \{\{ft\|(TEAM[123])}} </tt> &rarr; <tt>$1</tt>
 * with the "Regex" box ticked. This regex works for me in the AWB regex tester. SiBr4 (talk) 17:09, 12 April 2014 (UTC)
 * I think I'm now taking your request too literally and assumed you only wanted to find cases where the first parameter is "TEAM1", "TEAM2" or "TEAM3". A regex that catches every usage of a template ft would be
 * <tt> \{\{ft\|(.*)}} </tt> &rarr; <tt>$1</tt>
 * (the <tt>.*</tt> matches any text except newlines). SiBr4 (talk) 17:15, 12 April 2014 (UTC)

Many thxs!!! Xaris333 (talk) 18:52, 12 April 2014 (UTC)
 * Oh. I already replied at WT:AWB.  The regex above won't work very well.  Try it in the tester and see.  Mr Stephen (talk) 21:56, 12 April 2014 (UTC)
 * [Reply moved from Wikipedia talk:AutoWikiBrowser ]:
 * I would start with something like: find  and replace with   You may have to throw in a few   to catch unexpected spaces.  See Regular expression and test it using the tool. Mr Stephen (talk) 21:21, 12 April 2014 (UTC)


 * Yes, the above ( &rarr;  ) is bad.  The   is greedy and will mess up templates later on page.  Something like:
 * &rarr;
 * Would work. It captures everything up to the closing "}".  However, if a template is used internal to the ft the above regex will not capture the portion beyond the closing of the interior template (i.e. it will mess up).  If you expect that there might be interior templates, you need a more complex regex to account for it. Although not extensively tested, this:
 * &rarr;
 * looks like it works. However, it does not handle issues of malformed occurances, or interior use of a single "{", etc.


 * Please: Do not ask the same question on multiple pages at the same time. If you ask in one place and don't get an answer after some days, go ahead and ask in another place (after mentioning in the original location that you have also asked in another location). Asking in multiple places at one time is confusing, and results in much extra work for others. &mdash; Makyen (talk) 23:15, 12 April 2014 (UTC); update to reflect content moved from Wikipedia talk:AutoWikiBrowser 23:24, 12 April 2014 (UTC)


 * Thanks for correcting. I only just noticed that  likes to catch as many text as possible, and that my regex would replace templates outside the desired template when used on wikicode like  . SiBr4 (talk) 23:30, 13 April 2014 (UTC)

Help to replace 2
I want to insert a space. For example I want to insert a space after before 15,

one15 to one 15

But if there is another 15 in the article (with space in front of it), not to be replaced.

Xaris333 (talk) 22:28, 14 April 2014 (UTC)
 * An example page of what it is that you are actually trying to do would be helpful. However, a find and replace rule using a regular expression to to match the exact example you describe would be:
 * &rarr;
 * A more generalized regular expression which will separate any sequence where a ascii letter is followed by a number would be.
 * &rarr;  [NOTE: change of what was a second "A" to "a". This was a typo.]
 * Note: This does not account for the situations where a non-ascii Unicode letter is followed by a digit. However, that would open up the larger topic of how to deal with Unicode which is much too broad of an issue for this thread. It is also, probably, not something you need to think about at this time. &mdash; Makyen (talk) 23:27, 14 April 2014 (UTC); edited due to a typo in the example search text. 00:17, 15 April 2014 (UTC)

User:Makyen, example:
 * EnglandU15 to England U15
 * FranceU15 to France U15

but if is the article is Germany U15 not to replaced by Germany U15 (with 2 spaces). Xaris333 (talk) 23:35, 14 April 2014 (UTC)
 * NOTE: I changed the second example I provided above to correct a typo.
 * Your examples help, but I am still guessing about exactly what you desire.
 * lowercase letter(s) followed by a single uppercase letter then a number (number length is not considered, and does not matter). Put a space between the lowercase and uppercase letters:
 * &rarr;
 * lowercase letter(s) followed by at least one uppercase letter then a number (number length is not considered, and does not matter). Put a space between the lowercase and uppercase letters:
 * &rarr;
 * As a suggestion, AWB has a Regex Tester. It is accessed from the "Tools" drop-down menu.  You can use it to experiment with regular expressions. &mdash; Makyen (talk) 00:17, 15 April 2014 (UTC)

Ok. Thx. Xaris333 (talk) 00:23, 15 April 2014 (UTC)

Name parameter
In a template, there is

| name= Sam Andrew

I want to replace everything after | name=    with        to have

| name= Xaris333 (talk) 00:23, 15 April 2014 (UTC)
 * OK, this one is more complex. To make a specific regular expression it would help to know:
 * The name of the template within which you are wanting to make the change.
 * Do we account for the possibility that there might be sub-templates contained within the parameter value?
 * If so, might there be sub-sub-templates (how many levels)?
 * Do we account for the possibility that there might be wiki markup links (e.g. )?
 * Might there be multiple occurrences of the name (an erroneous situation)? If so, do we want to detect it and do something about it?
 * &mdash; Makyen (talk) 02:27, 15 April 2014 (UTC)


 * User:Makyen Is the greek version of Template:Infobox football biography but they are the same! Maybe is easiest to remove everything in in name parameter and then add | name= . I can do the second, but I can't to the first. Xaris333 (talk) 16:42, 15 April 2014 (UTC)
 * When I asked for the specific template that you are wanting to operate upon, I did actually mean that I wanted you to tell us the exact template, not one that it is just similar to. In order to prevent the regular expression from acting upon templates other than the one in which you desire to make changes, the regular expression has to include the name of the template desired. In addition, I realized belatedly I should have asked you to provide a pointer to a specific example so that any regular expression could be tested prior to my posting it. However, here is one that should work for Template:Infobox football biography:
 * &rarr;
 * NOTE1: Many of the "\" escape sequences in the above regular expression are not actually needed due to the context in which the various special characters are being used. However, the extra escapes don't hurt and it is better to be in the habit of entering the escapes rather than not use one where it is needed. In other words, you are much more likely to have a problem that results from not having an escape when you needed one than having an escape when you should not have one.
 * NOTE2:The above regular expression does not account for the possibility of having a wikitext sequence such as  within the template.  This is not accounted for for two reasons: 1. It is an unlikely sequence to occur and I am not expecting you to run this as an unattended bot (i.e. a human should catch any such unlikely errors). 2. A bug in AWB currently makes it such that a regular expression to account for that possibility does not work under "Normal settings", but does work under both the "Advanced settings" and in the Regex Tester. &mdash; Makyen (talk) 23:52, 17 April 2014 (UTC)

Regex tester
I am trying to piece together how Regexs work, based on the Help and the examples on this page. I am terrified of testing my ideas live on AWB, and hence live Wikipedia - surely there has to be a better way. I see mention of a Regex tester on this page, but no indication of what it is or where it might be found - is that available to normal editors?--Gronk Oz (talk) 10:36, 27 December 2015 (UTC)
 * Never mind - I found it, under AWB's Tools menu. Sorry for the inconvenience; this will be brilliant for learning!--Gronk Oz (talk) 11:22, 27 December 2015 (UTC)
 * Another thing you can do is create a page in your userspace with several examples, and then run your regexes against them. Happy testing!  GoingBatty (talk) 13:53, 27 December 2015 (UTC)

how to bold title in first line of the text
Hi, how can i bold title in first line of the text? for example

At foo article i want to do this foo is a bar with foo is a bar Yamaha5 (talk) 18:49, 20 October 2015 (UTC)
 * AWB's general fixes should already bold the title in the first line of text. Do you have some examples where it doesn't?  Thanks!  GoingBatty (talk) 14:15, 27 December 2015 (UTC)

Replace certain internal links with interwiki links
Hello. I'm moving several pages from my wiki to a sister project and gonna replace the remained redlinks with interwiki. What commands should I use? (I'm not good with regex)

For example, I wanna change some text Foo

to some text Foo

I also have a .txt with a list of all pages that I want to replace; can I use it in the AWB or I have to set replacement rules for every link manually?

--Mizushima (01/11/16) — Preceding unsigned comment added by Mizusima (talk • contribs) 20:28, 11 January 2016 (UTC)
 * Let's pretend you had three pages that you wanted to replace: foo, bar, and fubar. You could then use the following:
 * Good luck! GoingBatty (talk) 03:39, 13 January 2016 (UTC)
 * Good luck! GoingBatty (talk) 03:39, 13 January 2016 (UTC)
 * Good luck! GoingBatty (talk) 03:39, 13 January 2016 (UTC)

how to find entries for an infobox that do not match an enumerated list
Infobox album lists an acceptable list of enumerated values for various parameters such as type = studio|demo|ep|live|greatest|remix|box|compilation|mixtape|soundtrack|film|cast|video|other. If it's not one of those items, I would like to add it to the list and then I can review and replace as required. How can I generate that regex? Walter Görlitz (talk) 01:39, 8 February 2016 (UTC)

Help with find and replace
I want to replace  with , where “foobar” is any string of characters.

For example,  would be replaced with.

I am not too experienced with advanced find and replace, therefore I need some help. Thank you. ―PapíDimmi (talk) 16:39, 30 May 2016 (UTC)
 * @PapíDimmi I think replacing  with   (with regex on) will do it. I haven't tested this in AWB, so make sure to check your edits! —  crh 23   &thinsp;(Talk) 17:26, 30 May 2016 (UTC)
 * Thanks, but it did not work. It replaced  with  . ―PapíDimmi (talk) 17:32, 30 May 2016 (UTC)
 * @PapíDimmi Welp, silly mistake there: Use  in the replace box instead, that should work. (Worked in notepad++, I should test with a less forgiving engine !) —  crh 23   &thinsp;(Talk) 17:41, 30 May 2016 (UTC)
 * (Sorry for the rather late reply.) That works perfectly! Thank you. ―PapíDimmi (talk) 19:57, 30 May 2016 (UTC)

Actually, I have a problem. It replaced  with.

It should have replaced it with (I just replaced the text with “foo” and “bar.”)

I think this is because there was no space after. ―PapíDimmi (talk) 20:36, 30 May 2016 (UTC)


 * Your regex match is being greedy. If you think about it, the match is right, just not what you wanted.  You could try   (i.e. add a question mark after the asterix).  Mr Stephen (talk) 20:45, 30 May 2016 (UTC)
 * I did not see your reply until now, because I got no notification (since you did not tag me). Anyway, this works perfectly! Thank you, Mr. Stephen and Crh23, for your help. ―PapíDimmi (talk) 02:39, 31 May 2016 (UTC)

I need some help with find and replace
I asked this a couple of days ago but have not yet received a response, therefore I will ask here as well.

I would like to replace this: with this:

I.e., replacing the whole series tabs template with the tab2 template, only keeping a selected string of characters.

For example, it would replace this: with this:

I tried numerous things but failed. I am not too experienced with RegEx therefore need some help.

Can anyone please help me with this? I would really appreciate it! ―PapíDimmi (talk) 02:50, 31 May 2016 (UTC)
 * Use the regex tester in AWB (tools -> Regex tester). Paste the text to be searched in the obvious place and start building your regex in the "Find" box. Keep clicking the find button as you expand your regex.  When you get to the bit you want to keep, throw a $1 into the replace box and alternate between the find & replace buttons.  When the match fails or isn't right, start thinking.  Your starter for free: escape the curly brackets and the pipe symbols, and put a tick in the SingleLine box.  Mr Stephen (talk) 23:08, 31 May 2016 (UTC)
 * I like that you like to make me think as opposed to telling me outright, but it does not work for me. I cannot “start thinking,” as I have very little experience with RegEx. I have just recently started using AutoWikiBrowser.


 * I tried doing what you told me to, but I do not know how I am supposed to do it correctly. ―PapíDimmi (talk) 00:19, 1 June 2016 (UTC)


 * Assuming you only want that specific template formatting to be replaced, a regex that I think works is replace  with  . This will only match exactly what is in your examples, and move the characters after "tab1=" and before "|tab2=" into the new template. If you want it to match any invocation of  with a parameter of tab1, you would want to find   instead. —  crh 23   &thinsp;(Talk) 09:17, 1 June 2016 (UTC)
 * Hello. Thank you for your help, I really appreciate it. The first code (which only search for the series tabs with the specific parameters) worked, however, I would, in fact, like to match any invocation of, but the second code you provided did not work. ―PapíDimmi (talk) 21:14, 1 June 2016 (UTC)
 * It works when I try it. I fear it will fail if the   section is the last in the template. Mr Stephen (talk) 23:07, 1 June 2016 (UTC)


 * Here is what I did:


 * Find:
 * Replace:


 * Then I made AutoWikiBrowser scan an article which contained this:




 * …but it did not replace anything. I had only the “Regular expression” box ticked. ―PapíDimmi (talk) 01:48, 2 June 2016 (UTC)
 * No need for secrecy, which article? Mr Stephen (talk) 06:33, 2 June 2016 (UTC)
 * It does not matter which article; the bot scanned an article which contained the code I previously provided, and it replaced nothing; however, if I put the first code provided to me by Crh23, it will replace the series tabs with tab2. I do not know why, it does not matter how hard I try. ―PapíDimmi (talk) 07:04, 2 June 2016 (UTC)
 * @PapíDimmi: Whoops: forgot to mention that for the second one you need SingleLine ticked! mentioned that the above regex won't work when   is the last parameter, that can be fixed by finding   instead. —  crh 23   &thinsp;(Talk) 11:57, 2 June 2016 (UTC)
 * P.S. If you want to see how that regex works, have a look at this website, which breaks it down by token. — crh 23   &thinsp;(Talk) 11:59, 2 June 2016 (UTC)
 * Thank you so much for your help! If it is not too much trouble, could you help me with my last problem as well? ―PapíDimmi (talk) 20:50, 2 June 2016 (UTC)

Add spaces to headings
Hi!

I would like to replace  with , where “Foobar” is any string of characters (aka any word/words, symbol/symbols, number/numbers, etc.).

Example: Replace this: ==Amazing Header of 2016== This is some sort of section. Indeed, it is. with this: == Amazing Header of 2016 == This is some sort of section. Indeed, it is.

I would also like the same to apply to  and. <font face="Papyrus"><font color="#0020C2">― <font color="#FF2400">PapíDimmi <font color="#571B7E">( <font color="#437C17">talk | contribs <font color="#571B7E">) 19:05, 15 June 2016 (UTC)
 * Is this for the English WP? Mr Stephen (talk) 19:43, 15 June 2016 (UTC)
 * it's not - PapiDimmi doesn't have AWB rights on enwiki, and their previous edits aren't to enwiki. — crh 23   &thinsp;(Talk) 20:04, 15 June 2016 (UTC)
 * First, make sure this is desirable on the wiki you are working on — here on enwiki mass changing this would be forbidden, articles need only be consistent within themselves. If it is acceptable, try replacing  with  . —  crh 23   &thinsp;(Talk) 20:04, 15 June 2016 (UTC)
 * Yes, it is desirable—in fact, I was told to. <font face="Papyrus"><font color="#0020C2">― <font color="#FF2400">PapíDimmi <font color="#571B7E">( <font color="#437C17">talk | contribs <font color="#571B7E">) 14:49, 16 June 2016 (UTC)
 * Nah, that won't work.  seems OK.  Mr Stephen (talk) 21:29, 15 June 2016 (UTC)
 * Aren't we adding spaces? — crh 23   &thinsp;(Talk) 21:50, 15 June 2016 (UTC)
 * Indeed we are, but what if they are already there?  Mr Stephen (talk) 21:54, 15 June 2016 (UTC)
 * I assume then we will leave as is? — crh 23   &thinsp;(Talk) 21:56, 15 June 2016 (UTC)
 * Your regex will match several '=' followed by a space, as both '\S' and '.' match a '='. Mr Stephen (talk) 23:03, 15 June 2016 (UTC)
 * Good point, but yours doesn't fix that: both  and   match  . That said yours may be slightly more useful if we want to fix headings that have too many spaces. With that in mind, I propose  . —  crh 23   &thinsp;(Talk) 09:51, 16 June 2016 (UTC)
 * Thanks for your help! It seems to work nicely! <font face="Papyrus"><font color="#0020C2">― <font color="#FF2400">PapíDimmi <font color="#571B7E">( <font color="#437C17">talk | contribs <font color="#571B7E">)  14:49, 16 June 2016 (UTC)

Switch order of two sections
Is there a way I could switch the order of two sections?

For example, I would like to find this:

==Section 1==
 * Foo Bar
 * Lorem Ipsum
 * Bar Foo

Section 2

 * Dolor sit amet
 * Xyzzy

and replace it with this:

==Section 2==
 * Dolor sit amet
 * Xyzzy

Section 1

 * Foo Bar
 * Lorem Ipsum
 * Bar Foo

I would like to switch the order of two sections, keeping the name of the sections and their content, simply switching the order.

I have tried, but I cannot get it to work. I tried putting  in the find, below the sections, and   and   in the replace, but it did not work when I tested it. I also tested with, but I cannot get it to work. I have little experience with RegEx and would appreciate some help. <font face="Papyrus"><font color="#0020C2">― <font color="#FF2400">PapíDimmi <font color="#571B7E">( <font color="#437C17">talk | contribs <font color="#571B7E">) 00:27, 1 June 2016 (UTC)
 * @PapíDimmi: Can you clarify exactly what you want to happen: is it sections of two specific names you want swapped? Will they already be in a particular order? Will they be adjacent? If you could be specific about the use for this regex, that would really help. — crh 23   &thinsp;(Talk) 20:52, 2 June 2016 (UTC)
 * I want to switch the order of two specific sections in articles.


 * If I am going to be specific, I want the “See also” section, if it is above the “Appearances” section, to move below the “Appearances” section.


 * For example, I would want to switch this:




 * with this:




 * I.e., I would simply like to move the “See also” section below the “Appearances” section on pages where the “See also” section is above the “Appearances” section. If the “See also” section is already below the “Appearances” section, no changes should be made. <font face="Papyrus"><font color="#0020C2">― <font color="#FF2400">PapíDimmi <font color="#571B7E">( <font color="#437C17">talk | contribs <font color="#571B7E">) 21:02, 2 June 2016 (UTC)
 * OK, I think I've got something that works. You'll need SingleLine ticked. Replace  with  . To be precise, this takes the Appearances section (iff it is below the See also section) and puts it immediately above the see also section: if the sections are not adjacent it may cause whitespace problems, not sure. —  crh 23   &thinsp;(Talk) 21:33, 2 June 2016 (UTC)
 * Thank you, that almost works; however, it removes the space. I would like it to keep the space in-between the two sections.


 * E.g., it replaced this:

==See also==
 * lorem
 * ipsum
 * xyzzy

Appearances

 * foo
 * bar


 * with this:

==Appearances==
 * foo
 * bar

Appearances

 * Lorem ipsum


 * with this:

==Appearances==
 * Lorem ipsum

Appearances

 * Foo


 * with this:

==Appearances==
 * Foo

Appearances

 * Foo

with this: ==Appearances==
 * Foo

Bar
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
 * with this:

==Foo==

Bar
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.


 * I want there to be spaces in-between sections but not sections which are empty and are followed by another section instead. Therefore, I do not want it to replace the above example text with anything. Is there a workaround for this? Thank you. <font face="Papyrus"><font color="#0020C2">― <font color="#FF2400">PapíDimmi <font color="#571B7E">( <font color="#437C17">talk | contribs <font color="#571B7E">) 09:32, 19 June 2016 (UTC)
 * @PapíDimmi: Easy fix: . —  crh 23   &thinsp;(Talk) 13:15, 19 June 2016 (UTC)
 * That works. Thank you! <font face="Papyrus"><font color="#0020C2">― <font color="#FF2400">PapíDimmi <font color="#571B7E">( <font color="#437C17">talk | contribs <font color="#571B7E">) 13:23, 19 June 2016 (UTC)

A rule does not work like I want it to
Here are a rule I have created in advanced find and replace:

Find: Replace:

(I also tried with  and   but to no avail.)

Let us say that an article titled “Foobar” has the following therein:

I want and expect my rule to replace that with simply, but AutoWikiBrowser makes no change to the page.

I have the “Regular expression” box ticked off, by the way. When I tick it on, it replaces  with , which is, obviously, not what I want.

To sum it up: I want to remove the parameter of the  template in articles but only if the parameter is the same as the title of the article.

Can anyone please please help me with this? <font face="Papyrus"><font color="#0020C2">― <font color="#0000A0">PapíDimmi  <font color="#571B7E">( <font color="#4AA02C">talk | <font color="#4AA02C">contribs <font color="#571B7E">)  00:09, 25 June 2016 (UTC)
 * I don't know if  is supposed to not work without regex, but if you use regex, you need to "escape" special characters in the "Find" string by adding backslashes:  . <span title="User:SiBr₄">SiBr4  (<span title="User talk:SiBr₄">talk ) 14:24, 25 June 2016 (UTC)
 * (My apologies for the late reply.) That works perfectly. Thank you! <font face="Papyrus"><font color="#0020C2">― <font color="#0000A0">PapíDimmi  <font color="#571B7E">( <font color="#4AA02C">talk | <font color="#4AA02C">contribs <font color="#571B7E">)  15:58, 4 July 2016 (UTC)

Switch order of two fields
Is there a way I could switch the order of two sections?

For example, I would like to find this:


 * source = Own work
 * date = 2009-01-01

and replace it with this:


 * date = 2009-01-01
 * source = Own work

I would like to switch the order of these two fields sections, keeping the name of the sections and their content, simply switching the order (so the date the source remains, but the order changes).

My reason for this is due to the "date" field displaying before the "source" field in Wikimedia Commons file descriptions.

Thanks, OSX (talk • contributions) 04:39, 29 June 2016 (UTC)
 * You literally copied what I wrote. (proofs: Screenshot 1, Screenshot 2.) I do not have a problem with that; I just find it funny. <font face="Papyrus"><font color="#0020C2">― <font color="#0000A0">PapíDimmi  <font color="#571B7E">( <font color="#4AA02C">talk | <font color="#4AA02C">contribs <font color="#571B7E">)  17:47, 5 July 2016 (UTC)


 * What's the context? I assume this is within a particular template, which? — crh 23   &thinsp;(Talk) 09:44, 29 June 2016 (UTC)


 * It is for Commons:Template:Information. Thanks, OSX (talk • contributions) 12:03, 29 June 2016 (UTC)


 * Will the options always be adjacent? — crh 23   &thinsp;(Talk) 12:47, 29 June 2016 (UTC)


 * Yes. OSX (talk • contributions) 13:06, 29 June 2016 (UTC)


 * Find  and replace with , with SingleLine ticked. I haven't tested this much, and there will probably be cases where it does an incorrect replacement, but it should work usually. Make sure to check your edits! —  crh 23   &thinsp;(Talk) 14:05, 29 June 2016 (UTC)


 * Also, check that the change is welcome: it is a very minor change, so it might be unwelcome to make it on its own. — crh 23   &thinsp;(Talk) 14:06, 29 June 2016 (UTC)


 * Thanks for the code. For me though, it does not work. I have copied your "find" code into the "find" field and  into "replace with", with SingleLine ticked. OSX (talk • contributions) 14:24, 29 June 2016 (UTC)


 * Do you have Regex ticked too? — crh 23   &thinsp;(Talk) 14:42, 29 June 2016 (UTC)


 * I do now and that fixed it! Thank you very much for your help :) OSX (talk • contributions) 14:50, 29 June 2016 (UTC)


 * You're welcome! Sorry, forgot to mention it (doesn't show in the regex tester tool, for obvious reasons). — crh 23   &thinsp;(Talk) 16:11, 29 June 2016 (UTC)

Move bold
I want to replace this: Any words (born ) with this: Any words (born )

I want to keep the words and numbers, but move the bold so that the only the “Any words” at the start is bold and not the whole thing.

I tried this: Find: (.*) (born ) Replace: $1 (born )

…but that did not work.

Replace this: John Smith (born December 5, 1973) with this: John Smith (born December 5, 1973)
 * Example

Could anyone please help? <font face="Papyrus"><font color="#0020C2">― <font color="#0000A0">PapíDimmi  <font color="#571B7E">( <font color="#4AA02C">talk | <font color="#4AA02C">contribs <font color="#571B7E">)  23:36, 4 July 2016 (UTC)
 * Remember to escape special characters. I use regex101 for regex debugging, it will break it down for you. — crh 23   &thinsp;(Talk) 18:07, 5 July 2016 (UTC)
 * Ah, silly me. I forgot to escape the special characters. That online regex tester is really helpful, by the way. Thank you so much for your help! Hopefully I will be able to figure out future problems on my own instead of having to ask here. <font face="Papyrus"><font color="#0020C2">― <font color="#0000A0">PapíDimmi  <font color="#571B7E">( <font color="#4AA02C">talk | <font color="#4AA02C">contribs <font color="#571B7E">)  22:23, 5 July 2016 (UTC)

Add to bottom of page
Hi. I want to use AutoWikiBrowser to add a category to a page if it does not contain a template.

I added the template to the “Not contains” section in a rule in advanced find and replace, and then I tried with  and also the   modifier and replacing it with $1 …but that did not work at all.

I want to add a category to every page that does not include a specific template. Is there a way to do this? <font face="Papyrus"><font color="#0020C2">― <font color="#0000A0">PapíDimmi  <font color="#571B7E">( <font color="#4AA02C">talk | <font color="#4AA02C">contribs <font color="#571B7E">)  14:07, 6 July 2016 (UTC)
 * If you absolutely mean bottom of the page, do a append text under the "More..." tab and a skip if doesn't contain (if it has option do skip if contains  —  crh 23   &thinsp;(Talk) 14:14, 6 July 2016 (UTC)
 * You mean using the add category feature in the “More…” tab and setting skip options in the “Skip” tab? I want to add this category among many other changes, and I do not want to skip all of them just because the page does not include a template. I guess I could disable everything except the category add and do one go to add the category and then another with the other changes later. It is not what is most ideal to me, but since it apparently is my only option, I guess it will have to do. Thanks for your help. <font face="Papyrus"><font color="#0020C2">― <font color="#0000A0">PapíDimmi  <font color="#571B7E">( <font color="#4AA02C">talk | <font color="#4AA02C">contribs <font color="#571B7E">)  14:34, 6 July 2016 (UTC)

Replace XXxYYpx with XXpx
I want to replace "XXxYYpx" with "XXpx" in file names if both numbers are the same.

E.g., replace  with.

(I do not know how I match two of the same string of characters with RegEx.)

I thought that general fixes does this, but apparently it does not. <font face="Papyrus"><font color="#0020C2">― <font color="#0000A0">PapíDimmi  <font color="#571B7E">( <font color="#4AA02C">talk | <font color="#4AA02C">contribs <font color="#571B7E">)  17:14, 9 July 2016 (UTC)
 * Captured groups can be backreferenced in the Find string using a backslash followed by the number:  &rarr;  . Note that   and   aren't always interchangeable: any vertical image will render larger with the second code than with the first. <span title="User:SiBr₄">SiBr4  (<span title="User talk:SiBr₄">talk ) 18:04, 9 July 2016 (UTC)
 * Thank you! <font face="Papyrus"><font color="#0020C2">― <font color="#0000A0">PapíDimmi  <font color="#571B7E">( <font color="#4AA02C">talk | <font color="#4AA02C">contribs <font color="#571B7E">)  09:36, 10 July 2016 (UTC)

Match if two words are the same?
I want to replace something with something else—but only if two strings are exactly the same.

If they are not the same, I want to replace it with something else.

To be more specific, I want to replace  (where both “X”s are the same word or words) with , but if they are not the same word or words, I want to replace   (where “X” is one word, and “Y” is another) with.


 * Examples
 * Replace  with
 * Replace  with

<font face="Papyrus"><font color="#0020C2">― <font color="#0000A0">PapíDimmi  <font color="#571B7E">( <font color="#4AA02C">talk | <font color="#4AA02C">contribs <font color="#571B7E">)  03:03, 16 September 2016 (UTC)
 * You'll need two separate regexes. For example, &rarr; to change all links to templates, followed by &rarr; to remove the second parameter if link and label are the same. Case differences such as  can be matched by not marking the second as case-sensitive, but it doesn't seem possible to make only the first character case-insensitive, like Wikipedia titles. <span title="User:SiBr₄">SiBr4  (<span title="User talk:SiBr₄">talk ) 18:26, 16 September 2016 (UTC)


 * That works. Thank you! <font face="Papyrus"><font color="#0020C2">― <font color="#0000A0">PapíDimmi  <font color="#571B7E">( <font color="#4AA02C">talk | <font color="#4AA02C">contribs <font color="#571B7E">)  02:09, 17 September 2016 (UTC)

Problem with find and replace capture
I can't seem to get the Regex capture working. In AWB Regex Tester, I tested

to find a parameter of infobox settlement:

The replacement I used was

with the intended result to give

But the result AWB gave was erroneous:

Both Multiline and ExplicitCapture settings are checked. Is there something wrong with the settings or syntax? I tested it on Notepad++ and the replacement works as intended. Sanglahi86 (talk) 13:42, 13 October 2016 (UTC)
 * The code for backreferences in the "Replace" string is, not  . Backreferences in the "Find" string do use the latter form. <span title="User:SiBr₄">SiBr4  (<span title="User talk:SiBr₄">talk ) 19:53, 13 October 2016 (UTC)


 * Thank you very much for the info. Sanglahi86 (talk) 06:15, 14 October 2016 (UTC)