Jump to content

Wikipedia talk:AutoWikiBrowser/Regular expression

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

Regex help

[edit]

I am trying to remove wikilinks from (#/#) in List of Grand Slam women's singles champions#Champions by year

from

{{small|([[1886 Wimbledon Championships – Women's singles|1/6]])}}

to

{{small|(1/6)}}

by using (\{\{small\|\()\[\[Women's singles\|(\d+\/\d+)\]\]\)\}\} -> $1$2), which works on individual cases but not on a big table. It instead removes multiple cells. Any help would be appreciated. 8rz (talk) 12:03, 24 September 2025 (UTC)[reply]

I've replaced your {!} with | in your text above since it's already nowiki'd. It looks like you're missing some qualifiers; your example is 1886 Wimbledon Championships – Women's singles but your regex only looks for Women's singles. I'm going to play around with the regex a bit and see if I can get something that's a bit more robust. Primefac (talk) 22:17, 24 September 2025 (UTC)[reply]
Try \{\{small\s*\|\s*\(\[\[[^\|]*\|(\d*\/\d*)\]\]\)}} replacing with {{small|$1}} since I'm lazy and can't be bothered sorting out the extra grouping. Primefac (talk) 22:26, 24 September 2025 (UTC)[reply]
There are over 400 instances that need to be unlinked in the chart provided in the above link. 8rz (talk) 22:29, 24 September 2025 (UTC)[reply]
Gets the job done. Thanks. 8rz (talk) 22:31, 24 September 2025 (UTC)[reply]

JWB regex not working

[edit]

In User:8rz/sandbox 3, Removing all instances containing wheelchair within [[...|*]] using

\]\]\s*?\[\[.+wheelchair.+\|\*\]\]|\]\]\s*?\[\[wheelchair.+\|\*\]\] -> ]] works with find-replace regex in source but not with JWB. Need to hit multiple pages.

Tried it separately.

\]\]\s*?\[\[.+wheelchair.+\|\*\]\] -> ]]

\]\]\s*?\[\[wheelchair.+\|\*\]\] -> ]]

Still nothing. 8rz (talk) 17:32, 17 October 2025 (UTC)[reply]

Do you have it set to case-sensitive? That was the first thing I noticed (and only, so far, but I'll keep digging if that's not the case). Primefac (talk) 18:31, 19 October 2025 (UTC)[reply]
I did it manually instead. It was only 3 pages. But thanks. Dont know why JWB wasnt working. 8rz (talk) 22:42, 19 October 2025 (UTC)[reply]