#1   Report Post  
Posted to microsoft.public.word.docmanagement
RedRado03 RedRado03 is offline
external usenet poster
 
Posts: 1
Default Wildcard expression?


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   Report Post  
Posted to microsoft.public.word.docmanagement
Jay Freedman Jay Freedman is offline
external usenet poster
 
Posts: 9,854
Default Wildcard expression?

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

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Finding words that are 34 characters or higher--search expression erik_gregory Microsoft Word Help 1 February 7th 06 12:57 AM
Bizarre wildcard replace cfulmer Microsoft Word Help 2 January 29th 06 07:15 AM
Macro for bold text using wildcard Suusje Microsoft Word Help 0 September 26th 05 03:50 PM
wildcard find spanning the text of hyperlink Makhtar Microsoft Word Help 2 April 15th 05 07:28 PM
Replace and retain whatever the wildcard represents HONYAKUKA Microsoft Word Help 2 January 4th 05 04:12 AM


All times are GMT +1. The time now is 10:57 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"