![]() |
|
#1
|
|||
|
|||
![]()
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. |
#2
|
|||
|
|||
![]()
Thank you, sir. Much obliged.
Ulodesk |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
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 |
![]() |
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 |