Re: OT: regex pattern problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2004-01-07 at 13:26, Craig Tinson wrote:
> guys.. regex patterns are a *complete* mystery so am hoping someone can 
> help with one..

perl has some good regex tutorials.  man perlretut and man perlrequick
(I think) should get you slightly more familiar.

> 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?

It depends on what program you're using thats asking for the regex. 
perl, emacs, grep, less?

\(pg[.] [\d]+\)
would probably work in perl, whereas
(pg[.] [0-9]+) would probably work in emacs.

And don't forget to read up on regex's.  Once you've grasped them,
you'll start doing everything with regex's!

HTH,
-- 
Iain Buchanan <iain@xxxxxxxxxxxxxxxxxxx>

Remember, UNIX spelled backwards is XINU.
		-- Mt.

Attachment: signature.asc
Description: This is a digitally signed message part


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux