Share to: share facebook share twitter share wa share telegram print page

Wikipedia talk:AutoWikiBrowser/Regular expression

Regex help

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]
Prefix: a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9

Portal di Ensiklopedia Dunia

Kembali kehalaman sebelumnya