Alexander Gelbukh
Alexander Gelbukh

Reputation: 2230

Wildcard in Word 2013 to match zero or more whitespaces

What is the analog of regular expression's * modifier in Word 2013 wildcards?

In Word 2013 Find tool with wildcards enabled, apparently 0 is not a valid number as the number of matches. For example, if you type in the search box

fe{1,2}d

it will match fed and feed. However,

fe{0,2}d

will just produce an error message. What is the correct expression to match fd, fed, feed, feeed, etc.?

My motivation is to match a specific text when it is in a paragraph alone (i.e., surrounded by paragraph marks ^13) but with a possible whitespaces after it:

^13hello world {0,}^13

which just produces an error message. I did not find any solution without enabling wildcards, but even with wildcards enabled I can't get it working.

Similarly,

^13hello world @^13

matches one or more spaces, but I need zero or more.

Upvotes: 2

Views: 2377

Answers (1)

Christina
Christina

Reputation: 1379

I don't believe Word has ever had an equivalent for the zero-or-more operator, so while I haven't checked in Word 2013, I wouldn't expect to see it there either. (This page is old, but as far as I know it's still pretty authoritative on wildcard searching in Word: http://word.mvps.org/faqs/general/usingwildcards.htm)

In general, I would suggest doing two searches, one without the character and one using the 1-or-more operator.

ETA: Removed bad wildcard search.

Upvotes: 2

Related Questions