Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 02-09-2016, 11:50 AM
Cosmo Cosmo is offline Having problems with a Wildcard search Windows Vista Having problems with a Wildcard search Office 2007
Competent Performer
Having problems with a Wildcard search
 
Join Date: Mar 2012
Posts: 240
Cosmo is on a distinguished road
Default Having problems with a Wildcard search

I'm having a problem with a wildcard search/replace.



I'm looking for a specific string that can have an optional few characters in the middle, but Microsoft Word doesn't seem to have an way to include optional characters in the wildcard search (this would be super easy with Regular Expressions, which I understand much better than Word wildcard coding).

The string could be either 'BRANDŽ (sub brand text)' or 'BRANDŽ XXL (sub brand text)'

So I tried using a single wildcard character ('?'), land imiting it to a range of 1-5 characters using the following:

BRANDŽ?{1,5}\(sub brand text\)

But, this matches an unlimited number of characters if the sub brand text doesn't exist directly after the first occurrence of BRAND (it matches all of the text between 'BRANDŽ' and the next occurrence of '(sub brand text)' in the entire paragraph)

The following does work, but doesn't allow me for the instances where the optional characters don't exist:

BRANDŽ?????\(sub brand text\)

This is related to the issues I had in a previous thread (https://www.msofficeforums.com/word/...nces-each.html). I need to search for the first instance of either string on each page, so I can't run this as 2 separate searches.

I don't understand why my first attempt isn't working, I am specifying that I want 1-5 single character(s). I would expect using '*' instead of '?' to give me this result. I'm assuming I'm doing something wrong with the range to indicate 1-5 occurrences, but I don't see how to fix it. I haven't found anything indicating that you can't use the single character '?' wildcard with the '{n,m}' limits, but this is my only guess as to what is going wrong.

Any assistance/explanation would be gratefully appreciated.
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Issue with wildcard search mysterytramp Word 0 05-13-2015 10:40 AM
Where is the error in my wildcard search? Ulodesk Word 10 06-30-2014 01:46 PM
Having problems with a Wildcard search Wildcard search fails in table NobodysPerfect Word VBA 4 06-11-2014 11:02 AM
Having problems with a Wildcard search Tricky wildcard search NobodysPerfect Word 10 03-19-2014 04:29 AM
Wildcard search help. Kempston Word 0 11-13-2009 03:58 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:35 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft