Article View: adobe.scripting.indesign
Article #1696Re: using grep to find one match per line
From: Peter Kahrel
Date: Wed, 04 Feb 2009 10:05
Date: Wed, 04 Feb 2009 10:05
5 lines
1105 bytes
1105 bytes
GREP is case-sensitive, so "sin" doesn't find anything in "SG SIN Singapore". To search case-sensitively and whole words only, use (?i)\bsin\b But your question isn't entirely clear. You start by asking "How do you get grep to return a single line even when multiple matches are found on the same line?", then you say "I don't want the search to stop after a single match, it should continue on successive lines". These two seem to contradich each other. Do you mean you want one match per line? Peter
Technical Details
Message-ID:
<59b7c67c.0@webcrossing.la2eafNXanI>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!newshub.sdsu.edu!webcrossingReferences:
<59b7c67c.-1@webcrossing.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,b814e9ccdc1964a X-Google-Attributes: gidf939a,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: "Peter Kahrel" <kahrel@kahrel.plus.com> Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!newshub.sdsu.edu!webcrossing Newsgroups: adobe.scripting.indesign Subject: Re: using grep to find one match per line Message-ID: <59b7c67c.0@webcrossing.la2eafNXanI> Date: Wed, 4 Feb 2009 02:05:25 -0800 References: <59b7c67c.-1@webcrossing.la2eafNXanI> Lines: 10 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit