🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #1692

using grep to find one match per line

#1692
From: Schedule_Boy
Date: Wed, 04 Feb 2009 05:30
14 lines
920 bytes
Hi,

How do you get grep to return a single line even when multiple matches are found on the same line?

I tried the (?-m) and (?-s) without success.

eg. searching for the string "sin" in the following line should return only one result not 2.

SG SIN Singapore

I don't want the search to stop after a single match, it should continue on successive lines

Thanks,
SB
Technical Details
Message-ID: <59b7c67c.-1@webcrossing.la2eafNXanI>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!newshub.sdsu.edu!webcrossing

Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,b814e9ccdc1964a,start
X-Google-Attributes: gidf939a,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: Schedule_Boy@adobeforums.com
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!newshub.sdsu.edu!webcrossing
Newsgroups: adobe.scripting.indesign
Subject: using grep to find one match per line
Message-ID: <59b7c67c.-1@webcrossing.la2eafNXanI>
Date: Tue, 3 Feb 2009 21:30:01 -0800
Lines: 17
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit