Lively discussions on the graphic arts and publishing — in print or on the web

Go Back   Desktop Publishing Forum > General Discussions > Print Production & Automation

Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 08-05-2009, 07:21 AM   #4
Founding Sysop
ktinkel's Avatar
Join Date: Oct 2004
Location: In Connecticut, on the Housatonic River near its mouth at Long Island Sound.
Posts: 11,189

Originally Posted by Mike View Post
Any idea as to how I'd go about using grep to replace double quotes with single while ensuring that quotes within quotes are double without also substituting apostrophes in possessives or abbreviations?

He said, "I was told, 'The Jones' songs of the '60s can't be compared to today's 'cos they're older,' by a real aficionado."

which needs to become:

He said, 'I was told, "The Jones' songs of the '60s can't be compared to today's 'cos they're older," by a real aficionado.'
I would start by replacing single quotes with different characters (## and ###, say). That leaves the opening apostrophe in the contracted date in limbo; depending on how much of that sort of thing I expect, I might just let it go, then fix it later.

Then replace all the opening double quotes with opening singles; then do the closing sets.

Finally, search on the ## and ### you set up before and convert those to opening and closing singles respectively.

Then root out the opening apostrophes and fix those yourself. (Or maybe someone knows a better way.)

ktinkel is offline   Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Just the fax: fix or replace? marlene Business Matters 24 04-18-2007 06:31 AM
Tricky Font ID dthomsen8 Fonts & Typography 5 04-17-2007 11:56 AM
DW Search/Replace Regular Expressions Linda Baldwin Web Site Building & Maintenance 17 05-17-2006 07:41 AM
Replace a table with CSS ilox Web Design 7 08-22-2005 07:07 AM
You think fonts are tricky today? ktinkel Fonts & Typography 10 06-13-2005 01:18 PM

All times are GMT -8. The time now is 12:25 PM.

Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2018, vBulletin Solutions, Inc.
Contents copyright 2004–2018 Desktop Publishing Forum and its members.