Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Replacing with Wildcards > Replace Certain Hyphens with an En Dash

Replace Certain Hyphens with an En Dash

En dashes are used frequently in Anglo-American publishing. In the following section, Splitting Up Complex GREP Expressions, we deal separately with the case of page ranges, which can be dealt with automatically. Here we go into compounds that can’t be dealt with automatically. Consider the following examples:

French-English dictionaries

the Keenan-Comrie hypothesis

Sino-Tibetan languages

Anglo-American

According to certain style guides, in the first two examples the hyphen needs to be replaced with an en dash, but in the last two it should not. The trouble is that you can’t predict this: all you know is that potential candidates are two words, both with an initial capital, joined by a hyphen. But since this is an easily defined pattern, you can formulate find-and-replace patterns and do the replacements interactively. These are the required expressions (~= is the symbol for the en-dash):


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint