{"id":5038,"date":"2015-06-29T04:00:12","date_gmt":"2015-06-29T08:00:12","guid":{"rendered":"https:\/\/americaneditor.wordpress.com\/?p=5038"},"modified":"2016-09-19T19:10:29","modified_gmt":"2016-09-20T01:10:29","slug":"lyonizing-word-the-easy-way-not-so-easy","status":"publish","type":"post","link":"https:\/\/editorium.com\/archive\/lyonizing-word-the-easy-way-not-so-easy\/","title":{"rendered":"Lyonizing Word: The Easy Way, Not So Easy"},"content":{"rendered":"<p style=\"text-align:center;\"><em><strong>by Jack Lyon<\/strong><\/em><\/p>\n<p style=\"text-align:left;\">After publishing my last article, <a href=\"https:\/\/americaneditor.wordpress.com\/2015\/05\/27\/lyonizing-word-we-can-do-this-the-easy-way-or\/\" target=\"_blank\"><em>Lyonizing Word: We Can Do This the Easy Way, or . . .<\/em><\/a>,\u00a0Rich Adin, An American Editor,\u00a0wrote:<\/p>\n<blockquote>\n<p style=\"text-align:left;\">As written, your wildcard find and replace reduces four names to three if \u201cet al:\u201d is the ending characteristic. How do you write it so that it can handle any number of names, say up to seven?<\/p>\n<\/blockquote>\n<p style=\"text-align:left;\">Good question, and a nice challenge for a wildcard search. Let\u2019s say we have citations with strings of names like this:<\/p>\n<blockquote>\n<p style=\"text-align:left;\">Lyon J, Adin R, Carter TO, Jackson TT, Doe J, Smith K, Winger W, et al: blah blah blah<\/p>\n<\/blockquote>\n<p style=\"text-align:left;\">That\u2019s seven names, but let\u2019s see if we can make a wildcard string that will find any number of names and cut them down to three. My first impression is that this might be difficult or even impossible. But let\u2019s try the following wildcard string:<\/p>\n<p style=\"text-align:center;\">([!^013]@, ){3}([!^013]@, ){1,}(et al:)<\/p>\n<p style=\"text-align:left;\">Here\u2019s what that means:<\/p>\n<p style=\"text-align:left;padding-left:30px;\">Find any character except a carriage return: [!^013]<br \/>\nrepeated any number of times: @<br \/>\nfollowed by a comma<br \/>\nfollowed by a space<br \/>\nand enclosed in parentheses to form a \u201cgroup.\u201d<br \/>\nDo that three times in a row: {3}<br \/>\nFind using the same group: ([!^013]@, )<br \/>\nif it occurs once <em>or more<\/em> (as indicated by the comma): {1,}<br \/>\nfollowed by \u201cet al:\u201d in parentheses to form a group.<\/p>\n<p style=\"text-align:left;\">There\u2019s just one problem: It doesn\u2019t work. And that\u2019s how it often is with wildcards \u2014 sometimes you have to fiddle around to get the result you want; trial and error are key. So let\u2019s see if we can find just three instances of text using our group:<\/p>\n<p style=\"text-align:center;\">([!^013]@, ){3}<\/p>\n<p style=\"text-align:left;\">That doesn\u2019t work either. What in the world is going on here? Let\u2019s try using the group three times in a row:<\/p>\n<p style=\"text-align:center;\">([!^013]@, )([!^013]@, )([!^013]@, )<\/p>\n<p style=\"text-align:left;\">That <em>does<\/em> work. So why not this?<\/p>\n<p style=\"text-align:center;\">([!^013]@, ){3}<\/p>\n<p style=\"text-align:left;\">Could it be that {3} doesn\u2019t apply to the wildcard pattern ([!^013]@, ) itself but to the first instance of text that pattern finds? In other words, would that wildcard string\u00a0 find the first three names in a citation like the following?<\/p>\n<blockquote>\n<p style=\"text-align:left;\">Lyon J, Lyon J, Lyon J, Lyon J, Lyon J, Lyon J, Lyon J, et al: blah blah blah<\/p>\n<\/blockquote>\n<p style=\"text-align:left;\">Sure enough, that works! So we\u2019ve just learned something new about wildcard searches. For clarity, I\u2019ll restate it here:<\/p>\n<blockquote>\n<p style=\"text-align:left;\">Specifying how many times to find something (using {3}, for example) doesn\u2019t apply to the wildcard pattern it follows but to the first instance of text that pattern finds.<\/p>\n<\/blockquote>\n<p style=\"text-align:left;\">Unfortunately, that means we need to work out a different approach to our original problem. How about this?<\/p>\n<p style=\"text-align:center;\">([!^013]@, [!^013]@, [!^013]@, )([!^013]@, ){1,}(et al:)<\/p>\n<p style=\"text-align:left;\">Here\u2019s what that means:<\/p>\n<p style=\"text-align:left;padding-left:30px;\">Find any character except a carriage return: [!^013]<br \/>\nrepeated any number of times: @<br \/>\nfollowed by a comma<br \/>\nfollowed by a space<br \/>\nrepeated three times<br \/>\nand enclosed in parentheses to form a \u201cgroup.\u201d<br \/>\nFind using the same group: ([!^013]@, )<br \/>\nif it occurs once <em>or more<\/em> (as indicated by the comma): {1,}<br \/>\nfollowed by \u201cet al:\u201d in parentheses to form a group.<\/p>\n<p style=\"text-align:left;\">But no, that doesn\u2019t work either! Why not? Oh, yeah, because of that {1,}. As we discovered earlier:<\/p>\n<blockquote>\n<p style=\"text-align:left;\">Specifying how many times to find something (using {3}, for example) doesn\u2019t apply to the wildcard pattern it follows but to the first instance of text that pattern finds.<\/p>\n<\/blockquote>\n<p style=\"text-align:left;\">Well, okay, then. We\u2019ll stop using numbers (such as {1,}) to specify how many times a pattern should be repeated (at least for our current purposes). Let\u2019s try this instead:<\/p>\n<p style=\"text-align:center;\">([!^013]@, [!^013]@, [!^013]@, )[!^013]@(et al:)<\/p>\n<p style=\"text-align:left;\">Here\u2019s what that means:<\/p>\n<p style=\"text-align:left;padding-left:30px;\">Find any characters except a carriage return: [!^013]<br \/>\nrepeated any number of times: @<br \/>\nfollowed by a comma<br \/>\nfollowed by a space<br \/>\nrepeated three times<br \/>\nand enclosed in parentheses to form a \u201cgroup.\u201d<br \/>\nThen find any character except a carriage return: [!^013]<br \/>\nrepeated any number of times: @<br \/>\nfollowed by \u201cet al:\u201d in parentheses to form a group.<\/p>\n<p style=\"text-align:left;\">Well, son of a gun; that actually works. So now we can use the following in the \u201cReplace With\u201d box:<\/p>\n<p style=\"text-align:left;padding-left:90px;\">12<\/p>\n<p style=\"text-align:left;\">Here\u2019s what that means:<\/p>\n<p style=\"text-align:left;padding-left:30px;\">Replace everything that was found<br \/>\nwith the text represented by group 1: 1<br \/>\nfollowed by the text represented by group 2: 2<\/p>\n<p style=\"text-align:left;\">Group 1, you\u2019ll remember, was this:<\/p>\n<p style=\"text-align:left;padding-left:90px;\">([!^013]@, [!^013]@, [!^013]@, )<\/p>\n<p style=\"text-align:left;\">It finds the first three names in our citations. And group 2 was this:<\/p>\n<p style=\"text-align:left;padding-left:90px;\">(et al:)<\/p>\n<p style=\"text-align:left;\">It finds the end of our citations.<\/p>\n<p style=\"text-align:left;\">And so, finally, we\u2019ve succeeded in fulfilling Rich\u2019s original request:<\/p>\n<blockquote>\n<p style=\"text-align:left;\">As written, your wildcard find and replace reduces four names to three if \u201cet al:\u201d is the ending characteristic. How do you write it so that it can handle any number of names, say up to seven?<\/p>\n<\/blockquote>\n<p style=\"text-align:left;\">Sometimes the easy way isn\u2019t so easy. Nevertheless, it\u2019s almost always worth pursuing. In Rich\u2019s case, it reduced his editing time from hours (removing extraneous names by hand) to minutes (removing the names with a wildcard find and replace). It also gave Rich a wildcard search that he can save in his fabulous <a href=\"http:\/\/www.wordsnSync.com\" target=\"_blank\">EditTools<\/a> software for use with future projects. And it provided a deeper and clearer understanding of how to use wildcard searches.<\/p>\n<p style=\"text-align:left;\">After all these years of editing, wildcard searching is the tool I rely on the most. I encourage you to invest the time needed to learn to use this tool, which will repay your efforts many times over. A good place to start is my free paper \u201c<a href=\"http:\/\/www.editorium.com\/ftp\/AdvancedFind.zip\" target=\"_blank\">Advanced Find and Replace in Microsoft Word<\/a>.\u201d<\/p>\n<p style=\"text-align:left;\">I hope you\u2019ll also watch for my forthcoming Wildcard Cookbook for Microsoft Word. I\u2019m still trying to find more real-life examples for the book, so if you have some particularly sticky problems that might be solved using a wildcard search, I hope you\u2019ll <a href=\"http:\/\/editor@editorium.com\/\" target=\"_blank\">send them my way<\/a>. Maybe I can save you some work and at the same time figure out solutions that will help others in the future. Thanks for your help!<\/p>\n<p style=\"text-align:left;\"><em>Jack Lyon (<\/em><a href=\"mailto:editor@editorium.com\"><em>editor@editorium.com<\/em><\/a><em>)\u00a0owns and operates the <\/em><a title=\"The Editorium\" href=\"http:\/\/www.editorium.com\" target=\"_blank\"><em>Editorium<\/em><\/a><em>, which provides macros and information to help editors and publishers do mundane tasks quickly and efficiently. He is the author of <\/em><a title=\"Microsoft Word for Publishing Professionals\" href=\"http:\/\/www.editorium.com\/msword4pubpros.htm\" target=\"_blank\">Microsoft Word for Publishing Professionals<\/a> <em>and of <\/em><a title=\"Macro Cookbook at Barnes &amp; Noble\" href=\"http:\/\/www.barnesandnoble.com\/w\/macro-cookbook-for-microsoft-word-jack-m-lyon\/1107868228?ean=9781434103321\" target=\"_blank\">Macro Cookbook for Microsoft Word<\/a>.<em> Both books will help you learn more about macros and how to use them.<\/em><\/p>\n<hr \/>\n<p>&nbsp;<\/p>\n<h4 style=\"text-align:center;\">Looking for a Deal?<\/h4>\n<p>You can buy <a title=\"EditTools\" href=\"http:\/\/wordsnsync.com\/edittools.php\" target=\"_blank\">EditTools<\/a> in a package with <a title=\"PerfectIt\" href=\"http:\/\/intelligentediting.com\/\" target=\"_blank\">PerfectIt<\/a> and <a title=\"Editor's Toolkit Plus 2014\" href=\"http:\/\/www.editorium.com\/ETKPlus2014.htm\" target=\"_blank\">Editor's Toolkit<\/a> at a special savings of $78 off the price if bought individually. To purchase the package at the special deal price, click <a title=\"Editor's Toolkit Ultimate package\" href=\"http:\/\/wordsnsync.com\/editors-toolkit.php\" target=\"_blank\">Editor's Toolkit Ultimate<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<a href=\"https:\/\/editorium.com\/archive\/lyonizing-word-the-easy-way-not-so-easy\/\" rel=\"bookmark\" title=\"Permalink to Lyonizing Word: The Easy Way, Not So Easy\"><p>by Jack Lyon After publishing my last article, Lyonizing Word: We Can Do This the Easy Way, or . . .,\u00a0Rich Adin, An American Editor,\u00a0wrote: As written, your wildcard find and replace reduces four names to three if \u201cet al:\u201d is the ending characteristic. How do you write it so that it can handle any [&hellip;]<\/p>\n<\/a>","protected":false},"author":9,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[77,256,175,409],"tags":[1052,267,51,188,985],"class_list":{"0":"post-5038","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-computers-and-software","7":"category-contributor-article","8":"category-editing-tools-editorial-matters","9":"category-lyonizing-word","10":"tag-author-names-in-references","11":"tag-jack-lyon","12":"tag-professional-editors","13":"tag-saving-time","14":"tag-wildcard-macro","15":"h-entry","16":"hentry"},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p3gfno-1jg","_links":{"self":[{"href":"https:\/\/editorium.com\/archive\/wp-json\/wp\/v2\/posts\/5038","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/editorium.com\/archive\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/editorium.com\/archive\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/editorium.com\/archive\/wp-json\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/editorium.com\/archive\/wp-json\/wp\/v2\/comments?post=5038"}],"version-history":[{"count":1,"href":"https:\/\/editorium.com\/archive\/wp-json\/wp\/v2\/posts\/5038\/revisions"}],"predecessor-version":[{"id":6147,"href":"https:\/\/editorium.com\/archive\/wp-json\/wp\/v2\/posts\/5038\/revisions\/6147"}],"wp:attachment":[{"href":"https:\/\/editorium.com\/archive\/wp-json\/wp\/v2\/media?parent=5038"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/editorium.com\/archive\/wp-json\/wp\/v2\/categories?post=5038"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/editorium.com\/archive\/wp-json\/wp\/v2\/tags?post=5038"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}