Search code examples
replacems-wordfindwildcard

Why does this wildcard search string return 'pattern match not valid'?


In Word's Find and replace dialogue, with Wildcards turned on, the below works

^013[1]. (*)^013(*)^013[2]. (*)^013(*)^013[3]. (*)^013(*)^013[4]. (*)^013(*)^013[5]. (*)^013

The below does not work.

^013[1]. (*)^013(*)^013[2]. (*)^013(*)^013[3]. (*)^013(*)^013[4]. (*)^013(*)^013[5]. (*)^013(*)^013

It returns the message below

[![enter image description here][1]][1]

The only difference is ()^013* on the end of the second search string. Unless I'm missing it, number 5 is the same as all the other parts of the find string, but Word returns an error.

Doing this hurt my eyes and brain so it's possible I made a typo, but don't see anything like that. What is going wrong? [1]: https://i.sstatic.net/Ey5aW.png


Solution

  • If you remove the first (*) and search for #^13[1]. ^13(*)^13[2]. (*)^13(*)^13[3]. (*)^13(*)^13[4]. (*)^13(*)^13[5]. (*)^13(*)^13 it works.

    So it is not the last ^013 but more likely the number of (*) that crashes.

    (*)(*)(*)(*)(*)(*)(*)(*)(*)(*) = 10 times (*) throws the same error whereas 9 times (*) are ok.