On Wed, Jan 07, 2004 at 03:59:55AM +0000, Craig Tinson wrote:
> guys.. regex patterns are a *complete* mystery so am hoping someone can
> help with one..
> 
> I have to find all entries in a file which match the following:
> 
> (pg. 2)
> (pg. 210)
> (pg. 211)
> (pg. 309)
> (pg. 4000)
> 
> etc etc
> 
> what regex pattern would I use?
> 
> TIA
> 
> Craig
Hi Craig,
are you going to do a simple grep,egrep,perl,...
does the pattern have to start at the beginning of the line...
(what are the full details of the match)

here is a simple egrep example:
egrep "\(pg\. .+\)" test.txt 

translations: find a pattern startring at any point in the line that
starts with '(pg. ' + some characater + ending with ')'

-Kev

Attachment: signature.asc
Description: Digital signature

Reply via email to