Operator: Pkbwcgs ( talk · contribs · SUL · edit count · logs · page moves · block log · rights log · ANI search)
Time filed: 21:56, Monday, December 17, 2018 ( UTC)
Function overview: Fix CW Error #86 (External link with two brackets)
Automatic, Supervised, or Manual: Supervised
Programming language(s): AWB
Source code available: AWB
Links to relevant discussions (where appropriate):
Edit period(s): Once a week
Estimated number of pages affected: 100 to 200 a week
Namespace(s): Mainspace
Exclusion compliant (Yes/No): Yes
Function details: The bot will use AWB to fix error 86 (External link with two brackets). The bot is going to remove the double brackets around the link. For example, [[http://www.google.co.uk]] will become [http://www.google.co.uk]. General fixes will be switched on. Spelling fixing is going to be switched off.
Do you mean error #86? Primefac ( talk) 22:00, 17 December 2018 (UTC) reply
Find: \[\[(https?://[^][<>\s"]+) *((?<= )[^\n\]]*|)\]\]
Replace: [$1 $2]
The bot is going to use that regular expression to complete this task. I have sharpened my programming skills in the last couple of days and I was practising regular expressions recently.
Pkbwcgs (
talk) 22:21, 24 December 2018 (UTC)
reply
Your regex simply doesn't take into account the situation where someone uses pipes in an elink (e.g. [[https:google.com|Google]]
. I think the best regex would be along the lines of \[\[(http.*?)( |\|)?(.*?)?]]
and replacing with [$1 $3]
. This should cover all of the junk mentioned above, but you'll need to go back over those 50 edits and fix all of the pipe-not-space elink errors (don't you have a bot task that does this already?).
Primefac (
talk) 19:17, 25 December 2018 (UTC)
reply
$2
representing the pipe which should be taken out so it can't be in the replace expression.
Pkbwcgs (
talk) 20:29, 25 December 2018 (UTC)
reply
Approved for trial (25 edits). Please provide a link to the relevant contributions and/or diffs when the trial is complete.
Primefac (
talk) 18:15, 26 December 2018 (UTC)
reply
[[https://www.google.co.uk]]
, it is replacing it with [https://www.google.co.uk ]
which is wrong. We don't need a space before the last square bracket.
Pkbwcgs (
talk) 19:03, 26 December 2018 (UTC)
reply
_]
(_ used to indicate a space) and replace with
.
Primefac (
talk) 20:13, 26 December 2018 (UTC)
reply
\[\[(http[^ \|]*?)]]
→ [$1]
\[\[(http.*?)(?:(?: |\|)(.*?))?]]
→ [$1 $2]
Approved. As far as the edits themselves, they're perfectly fine. The pages where they're found, and how they're used, are another matter entirely. I would suggest periodically piping the edit list to the MOS and GOCE wikiprojects so that they can fix them.
Primefac (
talk) 02:38, 28 December 2018 (UTC)
reply
Operator: Pkbwcgs ( talk · contribs · SUL · edit count · logs · page moves · block log · rights log · ANI search)
Time filed: 21:56, Monday, December 17, 2018 ( UTC)
Function overview: Fix CW Error #86 (External link with two brackets)
Automatic, Supervised, or Manual: Supervised
Programming language(s): AWB
Source code available: AWB
Links to relevant discussions (where appropriate):
Edit period(s): Once a week
Estimated number of pages affected: 100 to 200 a week
Namespace(s): Mainspace
Exclusion compliant (Yes/No): Yes
Function details: The bot will use AWB to fix error 86 (External link with two brackets). The bot is going to remove the double brackets around the link. For example, [[http://www.google.co.uk]] will become [http://www.google.co.uk]. General fixes will be switched on. Spelling fixing is going to be switched off.
Do you mean error #86? Primefac ( talk) 22:00, 17 December 2018 (UTC) reply
Find: \[\[(https?://[^][<>\s"]+) *((?<= )[^\n\]]*|)\]\]
Replace: [$1 $2]
The bot is going to use that regular expression to complete this task. I have sharpened my programming skills in the last couple of days and I was practising regular expressions recently.
Pkbwcgs (
talk) 22:21, 24 December 2018 (UTC)
reply
Your regex simply doesn't take into account the situation where someone uses pipes in an elink (e.g. [[https:google.com|Google]]
. I think the best regex would be along the lines of \[\[(http.*?)( |\|)?(.*?)?]]
and replacing with [$1 $3]
. This should cover all of the junk mentioned above, but you'll need to go back over those 50 edits and fix all of the pipe-not-space elink errors (don't you have a bot task that does this already?).
Primefac (
talk) 19:17, 25 December 2018 (UTC)
reply
$2
representing the pipe which should be taken out so it can't be in the replace expression.
Pkbwcgs (
talk) 20:29, 25 December 2018 (UTC)
reply
Approved for trial (25 edits). Please provide a link to the relevant contributions and/or diffs when the trial is complete.
Primefac (
talk) 18:15, 26 December 2018 (UTC)
reply
[[https://www.google.co.uk]]
, it is replacing it with [https://www.google.co.uk ]
which is wrong. We don't need a space before the last square bracket.
Pkbwcgs (
talk) 19:03, 26 December 2018 (UTC)
reply
_]
(_ used to indicate a space) and replace with
.
Primefac (
talk) 20:13, 26 December 2018 (UTC)
reply
\[\[(http[^ \|]*?)]]
→ [$1]
\[\[(http.*?)(?:(?: |\|)(.*?))?]]
→ [$1 $2]
Approved. As far as the edits themselves, they're perfectly fine. The pages where they're found, and how they're used, are another matter entirely. I would suggest periodically piping the edit list to the MOS and GOCE wikiprojects so that they can fix them.
Primefac (
talk) 02:38, 28 December 2018 (UTC)
reply