Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 06-30-2014, 12:39 PM
Robert2 Robert2 is offline Where is the error in my wildcard search? Windows 8 Where is the error in my wildcard search? Office 2007
Competent Performer
 
Join Date: Jun 2013
Posts: 175
Robert2 will become famous soon enoughRobert2 will become famous soon enough
Default

This is because the repetition counters @ and {1,} behave differently. @ performs “lazy matching” and is happy with one instance of the preceding character or character set. {1,} performs “greedy matching” and gobbles up as many instances of the preceding character or character set as it can.

Let’s take “Daryl Paer 2013” as an example.

([!0-9^13]@)( )

catches “Daryl ” first, then goes on to catch “Paer ” (and goes on until it finds the final 4 digits and paragraph end mark).

On the other hand,

([!0-9^13]{1,})

catches “Daryl Paer ” directly. This is why “([!0-9^13]{1,})( )(<[0-9]{4})^13” does not work. There is no need to search for the space character preceding the 4 digits. It has already been found by ([!0-9^13]{1,}).

Now

([!0-9^13]{1,})( )(<[0-9]{4})^13

would work if you removed the space character from the search pattern:

([!0-9^13]{1,})(<[0-9]{4})^13

With such a search string, the Replace pattern itself needs to insert the space character after the 4 digits:

\2^32\1^p

Note that you could also use the following pattern:

Find:



([!0-9^13]@)(<[0-9]{4})^13

Replace:

\2^32\1^p

By the way, ^32 is the code for a space character.

HTH.
Reply With Quote
  #2  
Old 06-30-2014, 01:46 PM
Ulodesk Ulodesk is offline Where is the error in my wildcard search? Windows 7 64bit Where is the error in my wildcard search? Office 2013
Word 2013 Expert Cert
Where is the error in my wildcard search?
 
Join Date: Sep 2009
Location: Virginia
Posts: 872
Ulodesk is on a distinguished road
Default Thanks

Thank you, sir. Much obliged.

Ulodesk
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Where is the error in my wildcard search? Wildcard search fails in table NobodysPerfect Word VBA 4 06-11-2014 11:02 AM
Change characters outside a wildcard while keeping wildcard results nymusicman Word VBA 2 04-10-2014 08:17 AM
Where is the error in my wildcard search? Tricky wildcard search NobodysPerfect Word 10 03-19-2014 04:29 AM
Search for date and then apply mutliple search criteria in huge dataset maxtymo Excel 2 12-01-2013 04:52 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:01 AM.


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