资源描述:
《oreilly mastering regular expressions外语英文电子书》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、MasteringRegularExpressions,1stEdition,byJefferyFriedlIsawmyfirstexampleofthiswhenIdownloadeditthreeorfouryearsago.Ijustglancedatitandnoticedthatitwaschoppedup,inthateachpagewassplitintotwopages—itspannedtwoPDFpages.Soa340–350pagebookwoundupbeing750PDFpages.Youcouldn'tnavigatefromapagereferencetoa
2、notherpage,becausethepagenumbersobviouslydidn'tcoincide.AtthetimeIdidn'tgiveitmuchmorethought,asIdidn'tdotomuchwithregexanyway.FromtimetotimeIwouldseeanotherpost,soIwoulddownloaditandithasalwaysbeenthesameoldversion.AshortwhilebackIdidrunacrossaneedtoknowregexalittlebettersoIgotouttheversionthatIh
3、adandstartedtomakesomesenseoutofit.ThebookappearedtobejustwhatIneededbutwasjusthardtocomprehendthewayitwaschoppedup.Formyownuse,Ire-didthebooktotheextent,thateachbookpageisnowononePDFpage.Itwasnecessarytomakethepageslegalsize(8.5x14)todothisandmaintainatypefacelargeenoughtobeeasilyvisible.TheTable
4、ofContentsatthebeginningofthebookhasbeenomittedhereasIhaveincludedaTableofContentsinthisPDFdocument.TheIndexatthebackofthebookremainsasitwas,duetothefactthattherewasnoeasywaytore-doitwithoutamajortimeinvestment.Atleastnowthough,apagereferenceintheindexcanbenavigatedtousingtheAcrobatpagenavigationt
5、ools.Iamuploadingthisforotherstouseandhopethatitmightbehelpful.Feelfreetodeletethispage,butshouldyou,atalaterdatedecidetouploadityourself,pleaseindicatethatitisamodifiedversion,fromtheonethathasbeenaroundforyears.Page11IntroductiontoRegularExpressionsInthischapter:SolvingRealProblemsRegularExpress
6、ionsasaLanguageTheRegular-ExpressionFrameofMindEgrepMetacharactersExpandingtheFoundationPersonalGlimpsesHere'sthescenario:yourbossinthedocumentationdepartmentwantsatooltocheckfordoubledwords(suchas''thisthis"),acommonproblemwithdocumentssubjecttoheavyediting.Yourjobistocreateasolutionthatwill:Acce
7、ptanynumberoffilestocheck,reporteachlineofeachfilethathasdoubledwords,highlight(usingstandardANSIescapesequences)eachdoubledword,andensurethatthesourcefilenameappearswitheachlineinthereport.Workacrosslines,evenfi