Is it even possible to replace the Wikipedia citation from it using Microsoft word?

1

1

Is it even possible to replace the Wikipedia citation from it using Microsoft word ?

I tried the following regex which I verified on regex101.com(And It is a valid regex for citations) Regex

\[[0-9]+\]

for the following part of the article copied from Wikipedia.com

The rainbow pitta was described by the English ornithologist and bird artist John Gould in 1842, which is based on a specimen collected on the Cobourg Peninsula in the Northern Territory of Australia.[2][3] The specific name iris is taken from the Ancient Greek for "rainbow";[4] this is the origin of the common name as well.[5]

The species was once treated as a subspecies of the noisy pitta of eastern Australia,[6] and was also treated as being in a species complex with that species, the elegant pitta and the black-faced pitta,[7] although that arrangement was not universally accepted.[5] According to the 2006 study of the nuclear DNA of the pittas and other Old World suboscines found that its closest relative was the superb pitta of Manus Island off the coast of Papua New Guinea. The same study resulted in the pitta family being split from one genus into three, this species remaining in the genus Pitta.[8]

The species was long thought to be monotypic,[5] but in 1999 the Western Australian population was split into the subspecies P. i. johnstoneiana by Richard Schodde and Ian J. Mason.[3]

I know that Microsoft word has it is own weird regex(Regex to find/replace text in MS Word not working)

But Is it even possible to replace the Wikipedia citation from it using Microsoft word ? If not what other way can I use to replace these citations from the article?

The weird thing is there is a video on youtube which suggested that

use

[^?^?]

for

[99]

two digit numbers inside [] square brackets

but it did not work on Microsoft word 2016

ken thompson

Posted 2020-02-23T15:17:40.460

Reputation: 13

1Replace + in your first regex with @ (which means "one or more"). Should work. – endrju – 2020-02-24T23:24:08.950

You mean [[0-9]+] -> [[0-9]@] But It didn't work.I am using winword(2013) @endrju – ken thompson – 2020-02-25T03:10:28.873

Make sure you use wildcards in search options in Find and Replace dialog. And don't forget backslashes in regex (they are placed correctly in your first regex). – endrju – 2020-02-25T07:30:38.217

It worked. I think you should post it as an answer. @endrju . Thanks The correct pattern for it is \[[0-9]@\] -> Enable Use Wildcards. You are a genius. Thanks. Please post it as an answer. I will accept it .Where can I learn more about these Microsoft word patterns. – ken thompson – 2020-02-25T23:29:43.030

Answers

1

The correct form of a regex matching numbers inside brackets is:

\[[0-9]@\]

@ is used to find one or more occurrences of the previous character. Wildcards should be enabled for this to work.

You can find more on this for example on the WordMVP Site: https://wordmvp.com/FAQs/General/UsingWildcards.htm

endrju

Posted 2020-02-23T15:17:40.460

Reputation: 856