Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 08-16-2022, 02:20 AM
le_robert le_robert is offline Wildcard search for slightly different number formats Windows 10 Wildcard search for slightly different number formats Office 2016
Novice
Wildcard search for slightly different number formats
 
Join Date: Jul 2021
Location: France
Posts: 10
le_robert is on a distinguished road
Default Wildcard search for slightly different number formats

Hi,
I have a bunch of chapters and sub-chapters in a book in which the numbering works as follows:

X.X (e.g. 2.1)
X.XX (e.g. 2.11)
X.X.X (e.g. 2.1.1)
X.X.XX (e.g. 2.1.11)
X.XX.X (e.g. 2.11.1)

I want to know if it's possible to do a wildcard search that could capture all these possible combinations (I don't think there's a specific "or" operator). I have an expression that covers the last three but not the first two:
Code:
([0-9]@.[0-9]{1,2}@.)([0-9]{1,2})
Essentially I think I'm looking for something that makes the 3rd section of numbering optional, but to still capture it if it exists.

When I'm dealing with very specific references where I know what comes before and after (like a tab/para mark or specific punctuation/text) I can modify it to cover everything, but I'm looking for something that would pick it up under (almost) all circumstances. My instinct is that it's not possible, but would like confirmation from an expert before I give up!



Thanking you in advance
Reply With Quote
  #2  
Old 08-16-2022, 09:56 AM
Robert2 Robert2 is offline Wildcard search for slightly different number formats Windows 10 Wildcard search for slightly different number formats Office 2007
Competent Performer
 
Join Date: Jun 2013
Posts: 164
Robert2 will become famous soon enoughRobert2 will become famous soon enough
Default

The following wild card search would capture all 4 of your examples:

[0-9].[0-9]{1,2}.{0,1}[0-9]{1,2}
Reply With Quote
  #3  
Old 08-16-2022, 03:38 PM
macropod's Avatar
macropod macropod is offline Wildcard search for slightly different number formats Windows 10 Wildcard search for slightly different number formats Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Simpler:
Find = <[0-9]@.[0-9.]{1,}
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply

Tags
wildcards

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Wildcard Search gmaxey Word VBA 4 07-12-2020 05:13 PM
Wildcard search for slightly different number formats Problems with wildcard search VBA MikeForward Word VBA 3 02-19-2019 03:23 PM
Wildcard search for slightly different number formats Want to do single wildcard search for Z?Z or Z??Z MikeForward Word 9 02-19-2019 01:27 AM
Where is the error in my wildcard search? Ulodesk Word 10 06-30-2014 01:46 PM
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 12:25 PM.


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