Finding All Camel-Case Words

Written by Allen Wyatt (last updated October 2, 2021)
This tip applies to Word 2007, 2010, 2013, 2016, 2019, and Word in Microsoft 365


Leonardo has a document that contains a good number of camel-case words, which contain both upper- and lower-case letters (YouTube, WhatsApp, etc.). He wonders if there is a way to easily find such camel-case words in the document.

Yes, this can be done, but it is best to first figure out what, exactly, is meant by "camel case." We already know that Leonardo considers words like YouTube and WhatsApp to be camel case. These begin with an uppercase letter and then have a single capital letter in the remainder of the word, ending in a lowercase letter. What about words like iPhone or eMail, where the entire word is lowercase except for a single uppercase letter within the word? What about acronyms (which Word treats as words) such as UoT or PhD?

The mixture of uppercase and lowercase within a word is important to note. Each variation can be described as a pattern of letters, and because we can do that, then we can use a wildcard search to look for the pattern. For instance, let's say that you want to define camel-case words as those that begin with an uppercase letter and have another single uppercase letter elsewhere in the word, as in Leonardo's original examples of YouTube and WhatsApp. You could follow these steps to find such words:

  1. Press Ctrl+H to display the Replace tab of the Find and Replace dialog box.
  2. Display the Replace tab.
  3. Click the More button, if it is available.
  4. Make sure the Use Wildcards check box is selected.
  5. In the Find What box, enter "<[A-Z][a-z]@[A-Z][a-z]@>" (without the quote marks).
  6. Click on Find Next. Word finds the first occurrence.
  7. Continue clicking on Find Next, as desired.
  8. Close the Find and Replace dialog box.

The key to success with this approach is to correctly define the pattern used in step 5. In the pattern shown above, the characters "<[A-Z]" means "find a word that begins with exactly one uppercase letter." The following characters ("[a-z]@") means "followed by at least one lowercase letter." The next portion ("[A-Z]") means "followed by exactly one uppercase letter." The last portion ("[a-z]@>") means "followed by at least one lowercase letter that ends the word."

This pattern fulfills the camel-case definition of a single uppercase letter followed by lowercase letters, a single uppercase letter, and terminating lowercase letters. If you determine that your definition of camel case consists of a different pattern, then you only need to figure out the pattern and use that pattern in step 5, above.

If a single pattern may be a bit too restrictive—for instance, you might consider both SmartArt and iPhone to be camel-case words—they you might consider searching for just a portion of a word. In this case, use the pattern "[a-z][A-Z][a-z]" (without the quote marks) in step 5. This searches for a single lowercase letter followed by a single uppercase letter followed by a single lowercase letter. This pattern will find the "iPh" in "iPhone" and the "tAr" in "SmartArt." This should help you find any potential camel-case words in the document.

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (11307) applies to Microsoft Word 2007, 2010, 2013, 2016, 2019, and Word in Microsoft 365.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Leading Zeros in Page Numbers

Page numbers in Excel printouts are typically simple counters, without much chance for embellishment. If you want to add ...

Discover More

Recognizing a Header Row when Sorting

When you sort data in a worksheet, there are a couple ways you can do it. Using the simple way can result in ...

Discover More

Getting Rid of the Lock Screen

The Lock Screen is handy on mobile devices but may be a bother on your desktop PC. Here's how to turn the Lock Screen off ...

Discover More

The First and Last Word on Word! Bestselling For Dummies author Dan Gookin puts his usual fun and friendly candor back to work to show you how to navigate Word 2013. Spend more time working and less time trying to figure it all out! Check out Word 2013 For Dummies today!

More WordTips (ribbon)

Finding Missing Spaces before Numbers

If you want to insert a space between letters and digits in your document, you have a couple of tasks to perform. First, ...

Discover More

Searching for Footnote and Endnote Marks

Do you want to quickly search for any footnote or endnote marks in your document? Word makes it easy using the standard ...

Discover More

Applying Styles and Removing Characters using Find and Replace

The Find and Replace capabilities of Word are very powerful, allowing you to accomplish more than one task at a time. ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 1 + 1?

There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)


This Site

Got a version of Word that uses the ribbon interface (Word 2007 or later)? This site is for you! If you use an earlier version of Word, visit our WordTips site focusing on the menu interface.

Videos
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.