<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Grep Pattern Searching</title>
	<atom:link href="http://indesignsecrets.com/grep-pattern-searching.php/rss2" rel="self" type="application/rss+xml" />
	<link>http://indesignsecrets.com/grep-pattern-searching.php</link>
	<description>InDesignSecrets Blog and Podcast</description>
	<pubDate>Thu, 04 Dec 2008 21:16:29 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: David Blatner</title>
		<link>http://indesignsecrets.com/grep-pattern-searching.php#comment-470541</link>
		<dc:creator>David Blatner</dc:creator>
		<pubDate>Tue, 25 Nov 2008 19:25:26 +0000</pubDate>
		<guid isPermaLink="false">http://indesignsecrets.com/grep-pattern-searching.php#comment-470541</guid>
		<description>Yes, Michael, that was the problem! The backslashes were gone. I have gone back and edited my comment above. This code really does work, and it's very simple because it just searches for one or more digits that are followed by a uppercase or lowercase letter.

To type a backslash, you can type:
&#038; # 9 2 ; (with no spaces in between)</description>
		<content:encoded><![CDATA[<p>Yes, Michael, that was the problem! The backslashes were gone. I have gone back and edited my comment above. This code really does work, and it&#8217;s very simple because it just searches for one or more digits that are followed by a uppercase or lowercase letter.</p>
<p>To type a backslash, you can type:<br />
&#038; # 9 2 ; (with no spaces in between)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Walton Jones</title>
		<link>http://indesignsecrets.com/grep-pattern-searching.php#comment-470504</link>
		<dc:creator>Walton Jones</dc:creator>
		<pubDate>Mon, 24 Nov 2008 22:55:57 +0000</pubDate>
		<guid isPermaLink="false">http://indesignsecrets.com/grep-pattern-searching.php#comment-470504</guid>
		<description>Wow! You guys rule!
It works like a charm.

Thanks so much. That will save me hours of work.</description>
		<content:encoded><![CDATA[<p>Wow! You guys rule!<br />
It works like a charm.</p>
<p>Thanks so much. That will save me hours of work.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Murphy</title>
		<link>http://indesignsecrets.com/grep-pattern-searching.php#comment-470501</link>
		<dc:creator>Michael Murphy</dc:creator>
		<pubDate>Mon, 24 Nov 2008 22:26:37 +0000</pubDate>
		<guid isPermaLink="false">http://indesignsecrets.com/grep-pattern-searching.php#comment-470501</guid>
		<description>Try this one, Walton:

&lt;code&gt;&#60;(?&#60;!()d+?(?=[ul"(])&lt;/code&gt;

Basically, that's doing this:

&lt;i&gt;Any one or more digits at the beginning of a word, only if it is &lt;b&gt;not&lt;/b&gt; preceded by an opening parenthesis and only if it &lt;b&gt;is&lt;/b&gt; followed by either an upper- or lower-case character, quotation mark or opening parenthesis.&lt;/i&gt;

Those are the criteria you stated in your last post. I tested it on the one sample paragraph in your original post and it worked (but then again, so did my last test).

Let us know how that works.

&lt;b&gt;IMPORTANT:&lt;/b&gt; I'm seeing a problem in how the blog is presenting these little bits of code. It's not displaying some very crucial backslashes that need to be included before certain characters. I will e-mail you the GREP pattern since it can't be represented accurately here.</description>
		<content:encoded><![CDATA[<p>Try this one, Walton:</p>
<p><code>&lt;(?&lt;!()d+?(?=[ul"(])</code></p>
<p>Basically, that&#8217;s doing this:</p>
<p><i>Any one or more digits at the beginning of a word, only if it is <b>not</b> preceded by an opening parenthesis and only if it <b>is</b> followed by either an upper- or lower-case character, quotation mark or opening parenthesis.</i></p>
<p>Those are the criteria you stated in your last post. I tested it on the one sample paragraph in your original post and it worked (but then again, so did my last test).</p>
<p>Let us know how that works.</p>
<p><b>IMPORTANT:</b> I&#8217;m seeing a problem in how the blog is presenting these little bits of code. It&#8217;s not displaying some very crucial backslashes that need to be included before certain characters. I will e-mail you the GREP pattern since it can&#8217;t be represented accurately here.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Walton Jones</title>
		<link>http://indesignsecrets.com/grep-pattern-searching.php#comment-470499</link>
		<dc:creator>Walton Jones</dc:creator>
		<pubDate>Mon, 24 Nov 2008 21:24:06 +0000</pubDate>
		<guid isPermaLink="false">http://indesignsecrets.com/grep-pattern-searching.php#comment-470499</guid>
		<description>Thanks so much guys! You are getting me closer.
I tried your version Michael and it is almost there. The only problem is that it is also finding the first digit in the reference when the chapter consists of two digits.

If for example the reference were (Ex 24:12), it would find the first 2 in 24.

It is also finding digits in the middle of the verses when they happen to have numbers in them. I am afraid those may be really hard to get rid of, but do you think it is possible to take advantage of the fact that there is never any white space between the verse numbers and the next character (usually a letter, quotation mark, or open parenthesis)?</description>
		<content:encoded><![CDATA[<p>Thanks so much guys! You are getting me closer.<br />
I tried your version Michael and it is almost there. The only problem is that it is also finding the first digit in the reference when the chapter consists of two digits.</p>
<p>If for example the reference were (Ex 24:12), it would find the first 2 in 24.</p>
<p>It is also finding digits in the middle of the verses when they happen to have numbers in them. I am afraid those may be really hard to get rid of, but do you think it is possible to take advantage of the fact that there is never any white space between the verse numbers and the next character (usually a letter, quotation mark, or open parenthesis)?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Murphy</title>
		<link>http://indesignsecrets.com/grep-pattern-searching.php#comment-470497</link>
		<dc:creator>Michael Murphy</dc:creator>
		<pubDate>Mon, 24 Nov 2008 17:50:35 +0000</pubDate>
		<guid isPermaLink="false">http://indesignsecrets.com/grep-pattern-searching.php#comment-470497</guid>
		<description>Sorry for the late response, Walton...and thank you, David, for jumping in.

If I understand Walton's question correctly, I think what he's looking for is to superscript those numbers at the start of the verses, but not format any of the references to the verses in parentheses.

This requires a little more complex search. Using your sample paragraph, Walton, the "idea" of what you're looking for is this:

&lt;i&gt;Any one or more digits at the beginning of a word, but&lt;/i&gt; only &lt;i&gt;if  those digits are &lt;em&gt;not&lt;/em&gt; preceded by an opening parenthesis, upper- or lower-case character, colon or dash and&lt;/i&gt; only &lt;i&gt;if  they're &lt;em&gt;not&lt;/em&gt; followed by a closing parenthesis, colon or dash.&lt;/i&gt;

To do that, you need to use the Negative Lookbehind (only if it's not preceded by…) and Negative Lookahead (only if it's not followed by…) expressions.

That search would look like this:

&lt;code&gt;\&#60;(?&#60;!\(&#124;[lu]&#124;:&#124;-)\d+(?!\)&#124;:&#124;-)&lt;/code&gt;

As far as the replace function, you actually don't need to enter anything in the Change To field, as long as you're definitely applying formatting in the change operation. When a formatting change is attached to a query, the blank Change To field no longer means "replace with nothing" it means "leave the text unchanged, just follow the formatting instructions."

However, there's no harm at all using &lt;code&gt;$0&lt;/code&gt; as David suggests, or even &lt;code&gt;$1&lt;/code&gt; (Found Text and Found Text 1, respectively). The result will be the same.

Let me know if it works for you. I tested it on my end and it worked like a charm.</description>
		<content:encoded><![CDATA[<p>Sorry for the late response, Walton&#8230;and thank you, David, for jumping in.</p>
<p>If I understand Walton&#8217;s question correctly, I think what he&#8217;s looking for is to superscript those numbers at the start of the verses, but not format any of the references to the verses in parentheses.</p>
<p>This requires a little more complex search. Using your sample paragraph, Walton, the &#8220;idea&#8221; of what you&#8217;re looking for is this:</p>
<p><i>Any one or more digits at the beginning of a word, but</i> only <i>if  those digits are <em>not</em> preceded by an opening parenthesis, upper- or lower-case character, colon or dash and</i> only <i>if  they&#8217;re <em>not</em> followed by a closing parenthesis, colon or dash.</i></p>
<p>To do that, you need to use the Negative Lookbehind (only if it&#8217;s not preceded by…) and Negative Lookahead (only if it&#8217;s not followed by…) expressions.</p>
<p>That search would look like this:</p>
<p><code>\&lt;(?&lt;!\(|[lu]|:|-)\d+(?!\)|:|-)</code></p>
<p>As far as the replace function, you actually don&#8217;t need to enter anything in the Change To field, as long as you&#8217;re definitely applying formatting in the change operation. When a formatting change is attached to a query, the blank Change To field no longer means &#8220;replace with nothing&#8221; it means &#8220;leave the text unchanged, just follow the formatting instructions.&#8221;</p>
<p>However, there&#8217;s no harm at all using <code>$0</code> as David suggests, or even <code>$1</code> (Found Text and Found Text 1, respectively). The result will be the same.</p>
<p>Let me know if it works for you. I tested it on my end and it worked like a charm.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Blatner</title>
		<link>http://indesignsecrets.com/grep-pattern-searching.php#comment-470481</link>
		<dc:creator>David Blatner</dc:creator>
		<pubDate>Mon, 24 Nov 2008 13:45:05 +0000</pubDate>
		<guid isPermaLink="false">http://indesignsecrets.com/grep-pattern-searching.php#comment-470481</guid>
		<description>@Walton: Ah, it took me a while, but I think this will work. In the GREP "find what" field, search for:
&lt;code&gt;(&#92;d+?)(?=[&#92;l&#92;u])&lt;/code&gt;
(that's all one line, no spaces)
and in the change to field, type:
&lt;code&gt;$0&lt;/code&gt;
(which just means, "replace with what you found")

Now you can change the Change Format area to apply the character style or superscript, or whatever.</description>
		<content:encoded><![CDATA[<p>@Walton: Ah, it took me a while, but I think this will work. In the GREP &#8220;find what&#8221; field, search for:<br />
<code>(&#92;d+?)(?=[&#92;l&#92;u])</code><br />
(that&#8217;s all one line, no spaces)<br />
and in the change to field, type:<br />
<code>$0</code><br />
(which just means, &#8220;replace with what you found&#8221;)</p>
<p>Now you can change the Change Format area to apply the character style or superscript, or whatever.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Walton Jones</title>
		<link>http://indesignsecrets.com/grep-pattern-searching.php#comment-470459</link>
		<dc:creator>Walton Jones</dc:creator>
		<pubDate>Sat, 22 Nov 2008 23:41:52 +0000</pubDate>
		<guid isPermaLink="false">http://indesignsecrets.com/grep-pattern-searching.php#comment-470459</guid>
		<description>I am still looking for an answer to the problem I described in my previous comment. It is a problem of searching for only the verse numbers in a quote from the Bible without touching other digits (such as in the reference). I can’t figure it out!

Please help...

I watched the lynda.com tutorials...and they were great, but they didn’t cover this topic of GREP in enough detail to solve this problem.</description>
		<content:encoded><![CDATA[<p>I am still looking for an answer to the problem I described in my previous comment. It is a problem of searching for only the verse numbers in a quote from the Bible without touching other digits (such as in the reference). I can’t figure it out!</p>
<p>Please help&#8230;</p>
<p>I watched the lynda.com tutorials&#8230;and they were great, but they didn’t cover this topic of GREP in enough detail to solve this problem.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Walton Jones</title>
		<link>http://indesignsecrets.com/grep-pattern-searching.php#comment-470286</link>
		<dc:creator>Walton Jones</dc:creator>
		<pubDate>Mon, 17 Nov 2008 00:29:15 +0000</pubDate>
		<guid isPermaLink="false">http://indesignsecrets.com/grep-pattern-searching.php#comment-470286</guid>
		<description>How could I find all digits that are not included in parentheses? Basically I want to format a bunch of Bible references by making the verse numbers superscript, but leaving the reference alone. 

Here is an example:

63The Spirit is the one who gives life; human nature is of no help! The words that I have spoken to you are spirit and are life. 64But there are some of you who do not believe." (For Jesus had already known from the beginning who those were who did not believe, and who it was who would betray him.) (Jn 6:63-64)

See there are numbers in the text and numbers in the reference at the end. I want the numbers in the text to be superscripted, but not the numbers in the reference.

Is this possible? I can't figure out how to make exceptions with GREP. Please help!</description>
		<content:encoded><![CDATA[<p>How could I find all digits that are not included in parentheses? Basically I want to format a bunch of Bible references by making the verse numbers superscript, but leaving the reference alone. </p>
<p>Here is an example:</p>
<p>63The Spirit is the one who gives life; human nature is of no help! The words that I have spoken to you are spirit and are life. 64But there are some of you who do not believe.&#8221; (For Jesus had already known from the beginning who those were who did not believe, and who it was who would betray him.) (Jn 6:63-64)</p>
<p>See there are numbers in the text and numbers in the reference at the end. I want the numbers in the text to be superscripted, but not the numbers in the reference.</p>
<p>Is this possible? I can&#8217;t figure out how to make exceptions with GREP. Please help!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Murphy</title>
		<link>http://indesignsecrets.com/grep-pattern-searching.php#comment-400413</link>
		<dc:creator>Michael Murphy</dc:creator>
		<pubDate>Tue, 13 May 2008 15:33:37 +0000</pubDate>
		<guid isPermaLink="false">http://indesignsecrets.com/grep-pattern-searching.php#comment-400413</guid>
		<description>There's no reason I can think of to uninstall CS2. All CS versions of InDesign (and the other suite apps) can co-exist on the same system. They install separately, not as updates to the previous version. This is great for backward compatibility. I personally keep all CS versions on my machine for training and demonstration purposes. If you've got the room, it can't hurt. By default, the OS will open the newest version of the application when you double-click a ".indd" file.

One argument for not uninstalling it is that, once you do, you can't re-install an older version when a new version exists on the machine without first uninstalling all of the CS3 apps, then re-installing CS, CS2, and CS3 in that specific order. That's &lt;strong&gt;very&lt;/strong&gt; time-consuming.</description>
		<content:encoded><![CDATA[<p>There&#8217;s no reason I can think of to uninstall CS2. All CS versions of InDesign (and the other suite apps) can co-exist on the same system. They install separately, not as updates to the previous version. This is great for backward compatibility. I personally keep all CS versions on my machine for training and demonstration purposes. If you&#8217;ve got the room, it can&#8217;t hurt. By default, the OS will open the newest version of the application when you double-click a &#8220;.indd&#8221; file.</p>
<p>One argument for not uninstalling it is that, once you do, you can&#8217;t re-install an older version when a new version exists on the machine without first uninstalling all of the CS3 apps, then re-installing CS, CS2, and CS3 in that specific order. That&#8217;s <strong>very</strong> time-consuming.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Leona (LeeLee) Weiner</title>
		<link>http://indesignsecrets.com/grep-pattern-searching.php#comment-400403</link>
		<dc:creator>Leona (LeeLee) Weiner</dc:creator>
		<pubDate>Tue, 13 May 2008 15:23:21 +0000</pubDate>
		<guid isPermaLink="false">http://indesignsecrets.com/grep-pattern-searching.php#comment-400403</guid>
		<description>I just ordered Indesign CS3 for my MAC. How do I uninstall CS2 or should I?</description>
		<content:encoded><![CDATA[<p>I just ordered Indesign CS3 for my MAC. How do I uninstall CS2 or should I?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
