Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
![]() I am writing a probgram that searces for acronyms. I was wondering what the wildcard expression would be to search for whole words that contained characters such as: - or / for example: Door-Mat123 or help/please I am using a second criteria to identify it as a acronym based off the microsoft word selection. My search criteria can select Door then Mat123 but, not all as one selection. Is there a way to write this? This is what I have. Need to include the dashes and slashes within a word. ([A-Za-z0-9][A-Za-z0-9]*) |
#2
![]()
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
![]()
This search term will find the expressions you listed:
([A-Za-z0-9][A-Za-z0-9/-]{1,}) Notice a couple of things: - You can include the hyphen in a character range by listing it last; otherwise it's assumed to connect the start and end of a range. - There's no problem with including a forward slash in a character range. A backslash or any other special character would need to be preceded by a backslash -- see item 5 in http://word.mvps.org/FAQs/General/UsingWildcards.htm. - Using {1,} instead of * causes the search to use "greedy" matching, so it doesn't stop on finding Door but continues until it finds Door-Mat123. - If you immediately search again, the same search will find the second part of the combination (Mat123). To avoid this, set up your code at the end of each iteration to move the start of the search range to the end of the most recently found occurrence. -- Regards, Jay Freedman Microsoft Word MVP FAQ: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. RedRado03 wrote: I am writing a probgram that searces for acronyms. I was wondering what the wildcard expression would be to search for whole words that contained characters such as: - or / for example: Door-Mat123 or help/please I am using a second criteria to identify it as a acronym based off the microsoft word selection. My search criteria can select Door then Mat123 but, not all as one selection. Is there a way to write this? This is what I have. Need to include the dashes and slashes within a word. ([A-Za-z0-9][A-Za-z0-9]*) |
Reply |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Finding words that are 34 characters or higher--search expression | Microsoft Word Help | |||
Bizarre wildcard replace | Microsoft Word Help | |||
Macro for bold text using wildcard | Microsoft Word Help | |||
wildcard find spanning the text of hyperlink | Microsoft Word Help | |||
Replace and retain whatever the wildcard represents | Microsoft Word Help |