testoutput6 126 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923
  1. # This set of tests check the DFA matching functionality of pcre2_dfa_match(),
  2. # excluding UTF and Unicode property support. All matches are done using DFA,
  3. # forced by setting a default subject modifier at the start.
  4. #forbid_utf
  5. #subject dfa
  6. #newline_default lf anycrlf any
  7. /abc/
  8. abc
  9. 0: abc
  10. /ab*c/
  11. abc
  12. 0: abc
  13. abbbbc
  14. 0: abbbbc
  15. ac
  16. 0: ac
  17. /ab+c/
  18. abc
  19. 0: abc
  20. abbbbbbc
  21. 0: abbbbbbc
  22. \= Expect no match
  23. ac
  24. No match
  25. ab
  26. No match
  27. /a*/no_auto_possess
  28. a
  29. 0: a
  30. 1:
  31. aaaaaaaaaaaaaaaaa
  32. Matched, but offsets vector is too small to show all matches
  33. 0: aaaaaaaaaaaaaaaaa
  34. 1: aaaaaaaaaaaaaaaa
  35. 2: aaaaaaaaaaaaaaa
  36. 3: aaaaaaaaaaaaaa
  37. 4: aaaaaaaaaaaaa
  38. 5: aaaaaaaaaaaa
  39. 6: aaaaaaaaaaa
  40. 7: aaaaaaaaaa
  41. 8: aaaaaaaaa
  42. 9: aaaaaaaa
  43. 10: aaaaaaa
  44. 11: aaaaaa
  45. 12: aaaaa
  46. 13: aaaa
  47. 14: aaa
  48. aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\=ovector=10
  49. Matched, but offsets vector is too small to show all matches
  50. 0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
  51. 1: aaaaaaaaaaaaaaaaaaaaaaaaaaaaa
  52. 2: aaaaaaaaaaaaaaaaaaaaaaaaaaaa
  53. 3: aaaaaaaaaaaaaaaaaaaaaaaaaaa
  54. 4: aaaaaaaaaaaaaaaaaaaaaaaaaa
  55. 5: aaaaaaaaaaaaaaaaaaaaaaaaa
  56. 6: aaaaaaaaaaaaaaaaaaaaaaaa
  57. 7: aaaaaaaaaaaaaaaaaaaaaaa
  58. 8: aaaaaaaaaaaaaaaaaaaaaa
  59. 9: aaaaaaaaaaaaaaaaaaaaa
  60. aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\=dfa_shortest
  61. 0:
  62. /(a|abcd|african)/
  63. a
  64. 0: a
  65. abcd
  66. 0: abcd
  67. 1: a
  68. african
  69. 0: african
  70. 1: a
  71. /^abc/
  72. abcdef
  73. 0: abc
  74. \= Expect no match
  75. xyzabc
  76. No match
  77. xyz\nabc
  78. No match
  79. /^abc/m
  80. abcdef
  81. 0: abc
  82. xyz\nabc
  83. 0: abc
  84. \= Expect no match
  85. xyzabc
  86. No match
  87. /\Aabc/
  88. abcdef
  89. 0: abc
  90. \= Expect no match
  91. xyzabc
  92. No match
  93. xyz\nabc
  94. No match
  95. /\Aabc/m
  96. abcdef
  97. 0: abc
  98. \= Expect no match
  99. xyzabc
  100. No match
  101. xyz\nabc
  102. No match
  103. /\Gabc/
  104. abcdef
  105. 0: abc
  106. xyzabc\=offset=3
  107. 0: abc
  108. \= Expect no match
  109. xyzabc
  110. No match
  111. xyzabc\=offset=2
  112. No match
  113. /x\dy\Dz/
  114. x9yzz
  115. 0: x9yzz
  116. x0y+z
  117. 0: x0y+z
  118. \= Expect no match
  119. xyz
  120. No match
  121. xxy0z
  122. No match
  123. /x\sy\Sz/
  124. x yzz
  125. 0: x yzz
  126. x y+z
  127. 0: x y+z
  128. \= Expect no match
  129. xyz
  130. No match
  131. xxyyz
  132. No match
  133. /x\wy\Wz/
  134. xxy+z
  135. 0: xxy+z
  136. \= Expect no match
  137. xxy0z
  138. No match
  139. x+y+z
  140. No match
  141. /x.y/
  142. x+y
  143. 0: x+y
  144. x-y
  145. 0: x-y
  146. \= Expect no match
  147. x\ny
  148. No match
  149. /x.y/s
  150. x+y
  151. 0: x+y
  152. x-y
  153. 0: x-y
  154. x\ny
  155. 0: x\x0ay
  156. /(a.b(?s)c.d|x.y)p.q/
  157. a+bc+dp+q
  158. 0: a+bc+dp+q
  159. a+bc\ndp+q
  160. 0: a+bc\x0adp+q
  161. x\nyp+q
  162. 0: x\x0ayp+q
  163. \= Expect no match
  164. a\nbc\ndp+q
  165. No match
  166. a+bc\ndp\nq
  167. No match
  168. x\nyp\nq
  169. No match
  170. /a\d\z/
  171. ba0
  172. 0: a0
  173. \= Expect no match
  174. ba0\n
  175. No match
  176. ba0\ncd
  177. No match
  178. /a\d\z/m
  179. ba0
  180. 0: a0
  181. \= Expect no match
  182. ba0\n
  183. No match
  184. ba0\ncd
  185. No match
  186. /a\d\Z/
  187. ba0
  188. 0: a0
  189. ba0\n
  190. 0: a0
  191. \= Expect no match
  192. ba0\ncd
  193. No match
  194. /a\d\Z/m
  195. ba0
  196. 0: a0
  197. ba0\n
  198. 0: a0
  199. \= Expect no match
  200. ba0\ncd
  201. No match
  202. /a\d$/
  203. ba0
  204. 0: a0
  205. ba0\n
  206. 0: a0
  207. \= Expect no match
  208. ba0\ncd
  209. No match
  210. /a\d$/m
  211. ba0
  212. 0: a0
  213. ba0\n
  214. 0: a0
  215. ba0\ncd
  216. 0: a0
  217. /abc/i
  218. abc
  219. 0: abc
  220. aBc
  221. 0: aBc
  222. ABC
  223. 0: ABC
  224. /[^a]/
  225. abcd
  226. 0: b
  227. /ab?\w/
  228. abz
  229. 0: abz
  230. 1: ab
  231. abbz
  232. 0: abb
  233. 1: ab
  234. azz
  235. 0: az
  236. /x{0,3}yz/
  237. ayzq
  238. 0: yz
  239. axyzq
  240. 0: xyz
  241. axxyz
  242. 0: xxyz
  243. axxxyzq
  244. 0: xxxyz
  245. axxxxyzq
  246. 0: xxxyz
  247. \= Expect no match
  248. ax
  249. No match
  250. axx
  251. No match
  252. /x{3}yz/
  253. axxxyzq
  254. 0: xxxyz
  255. axxxxyzq
  256. 0: xxxyz
  257. \= Expect no match
  258. ax
  259. No match
  260. axx
  261. No match
  262. ayzq
  263. No match
  264. axyzq
  265. No match
  266. axxyz
  267. No match
  268. /x{2,3}yz/
  269. axxyz
  270. 0: xxyz
  271. axxxyzq
  272. 0: xxxyz
  273. axxxxyzq
  274. 0: xxxyz
  275. \= Expect no match
  276. ax
  277. No match
  278. axx
  279. No match
  280. ayzq
  281. No match
  282. axyzq
  283. No match
  284. /[^a]+/no_auto_possess
  285. bac
  286. 0: b
  287. bcdefax
  288. 0: bcdef
  289. 1: bcde
  290. 2: bcd
  291. 3: bc
  292. 4: b
  293. \= Expect no match
  294. aaaaa
  295. No match
  296. /[^a]*/no_auto_possess
  297. bac
  298. 0: b
  299. 1:
  300. bcdefax
  301. 0: bcdef
  302. 1: bcde
  303. 2: bcd
  304. 3: bc
  305. 4: b
  306. 5:
  307. aaaaa
  308. 0:
  309. /[^a]{3,5}/no_auto_possess
  310. xyz
  311. 0: xyz
  312. awxyza
  313. 0: wxyz
  314. 1: wxy
  315. abcdefa
  316. 0: bcdef
  317. 1: bcde
  318. 2: bcd
  319. abcdefghijk
  320. 0: bcdef
  321. 1: bcde
  322. 2: bcd
  323. \= Expect no match
  324. axya
  325. No match
  326. axa
  327. No match
  328. aaaaa
  329. No match
  330. /\d*/
  331. 1234b567
  332. 0: 1234
  333. xyz
  334. 0:
  335. /\D*/
  336. a1234b567
  337. 0: a
  338. xyz
  339. 0: xyz
  340. /\d+/
  341. ab1234c56
  342. 0: 1234
  343. \= Expect no match
  344. xyz
  345. No match
  346. /\D+/
  347. ab123c56
  348. 0: ab
  349. \= Expect no match
  350. 789
  351. No match
  352. /\d?A/
  353. 045ABC
  354. 0: 5A
  355. ABC
  356. 0: A
  357. \= Expect no match
  358. XYZ
  359. No match
  360. /\D?A/
  361. ABC
  362. 0: A
  363. BAC
  364. 0: BA
  365. 9ABC
  366. 0: A
  367. /a+/
  368. aaaa
  369. 0: aaaa
  370. /^.*xyz/
  371. xyz
  372. 0: xyz
  373. ggggggggxyz
  374. 0: ggggggggxyz
  375. /^.+xyz/
  376. abcdxyz
  377. 0: abcdxyz
  378. axyz
  379. 0: axyz
  380. \= Expect no match
  381. xyz
  382. No match
  383. /^.?xyz/
  384. xyz
  385. 0: xyz
  386. cxyz
  387. 0: cxyz
  388. /^\d{2,3}X/
  389. 12X
  390. 0: 12X
  391. 123X
  392. 0: 123X
  393. \= Expect no match
  394. X
  395. No match
  396. 1X
  397. No match
  398. 1234X
  399. No match
  400. /^[abcd]\d/
  401. a45
  402. 0: a4
  403. b93
  404. 0: b9
  405. c99z
  406. 0: c9
  407. d04
  408. 0: d0
  409. \= Expect no match
  410. e45
  411. No match
  412. abcd
  413. No match
  414. abcd1234
  415. No match
  416. 1234
  417. No match
  418. /^[abcd]*\d/
  419. a45
  420. 0: a4
  421. b93
  422. 0: b9
  423. c99z
  424. 0: c9
  425. d04
  426. 0: d0
  427. abcd1234
  428. 0: abcd1
  429. 1234
  430. 0: 1
  431. \= Expect no match
  432. e45
  433. No match
  434. abcd
  435. No match
  436. /^[abcd]+\d/
  437. a45
  438. 0: a4
  439. b93
  440. 0: b9
  441. c99z
  442. 0: c9
  443. d04
  444. 0: d0
  445. abcd1234
  446. 0: abcd1
  447. \= Expect no match
  448. 1234
  449. No match
  450. e45
  451. No match
  452. abcd
  453. No match
  454. /^a+X/
  455. aX
  456. 0: aX
  457. aaX
  458. 0: aaX
  459. /^[abcd]?\d/
  460. a45
  461. 0: a4
  462. b93
  463. 0: b9
  464. c99z
  465. 0: c9
  466. d04
  467. 0: d0
  468. 1234
  469. 0: 1
  470. \= Expect no match
  471. abcd1234
  472. No match
  473. e45
  474. No match
  475. /^[abcd]{2,3}\d/
  476. ab45
  477. 0: ab4
  478. bcd93
  479. 0: bcd9
  480. \= Expect no match
  481. 1234
  482. No match
  483. a36
  484. No match
  485. abcd1234
  486. No match
  487. ee45
  488. No match
  489. /^(abc)*\d/
  490. abc45
  491. 0: abc4
  492. abcabcabc45
  493. 0: abcabcabc4
  494. 42xyz
  495. 0: 4
  496. /^(abc)+\d/
  497. abc45
  498. 0: abc4
  499. abcabcabc45
  500. 0: abcabcabc4
  501. \= Expect no match
  502. 42xyz
  503. No match
  504. /^(abc)?\d/
  505. abc45
  506. 0: abc4
  507. 42xyz
  508. 0: 4
  509. \= Expect no match
  510. abcabcabc45
  511. No match
  512. /^(abc){2,3}\d/
  513. abcabc45
  514. 0: abcabc4
  515. abcabcabc45
  516. 0: abcabcabc4
  517. \= Expect no match
  518. abcabcabcabc45
  519. No match
  520. abc45
  521. No match
  522. 42xyz
  523. No match
  524. /1(abc|xyz)2(?1)3/
  525. 1abc2abc3456
  526. 0: 1abc2abc3
  527. 1abc2xyz3456
  528. 0: 1abc2xyz3
  529. /^(a*\w|ab)=(a*\w|ab)/
  530. ab=ab
  531. 0: ab=ab
  532. 1: ab=a
  533. /^(a*\w|ab)=(?1)/
  534. ab=ab
  535. 0: ab=ab
  536. 1: ab=a
  537. /^([^()]|\((?1)*\))*$/
  538. abc
  539. 0: abc
  540. a(b)c
  541. 0: a(b)c
  542. a(b(c))d
  543. 0: a(b(c))d
  544. \= Expect no match)
  545. a(b(c)d
  546. No match
  547. /^>abc>([^()]|\((?1)*\))*<xyz<$/
  548. >abc>123<xyz<
  549. 0: >abc>123<xyz<
  550. >abc>1(2)3<xyz<
  551. 0: >abc>1(2)3<xyz<
  552. >abc>(1(2)3)<xyz<
  553. 0: >abc>(1(2)3)<xyz<
  554. /^(?>a*)\d/
  555. aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa9876
  556. 0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa9
  557. \= Expect no match
  558. aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
  559. No match
  560. /< (?: (?(R) \d++ | [^<>]*+) | (?R)) * >/x
  561. <>
  562. 0: <>
  563. <abcd>
  564. 0: <abcd>
  565. <abc <123> hij>
  566. 0: <abc <123> hij>
  567. <abc <def> hij>
  568. 0: <def>
  569. <abc<>def>
  570. 0: <abc<>def>
  571. <abc<>
  572. 0: <>
  573. \= Expect no match
  574. <abc
  575. No match
  576. /^(?(?=abc)\w{3}:|\d\d)$/
  577. abc:
  578. 0: abc:
  579. 12
  580. 0: 12
  581. \= Expect no match
  582. 123
  583. No match
  584. xyz
  585. No match
  586. /^(?(?!abc)\d\d|\w{3}:)$/
  587. abc:
  588. 0: abc:
  589. 12
  590. 0: 12
  591. \= Expect no match
  592. 123
  593. No match
  594. xyz
  595. No match
  596. /^(?=abc)\w{5}:$/
  597. abcde:
  598. 0: abcde:
  599. \= Expect no match
  600. abc..
  601. No match
  602. 123
  603. No match
  604. vwxyz
  605. No match
  606. /^(?!abc)\d\d$/
  607. 12
  608. 0: 12
  609. \= Expect no match
  610. abcde:
  611. No match
  612. abc..
  613. No match
  614. 123
  615. No match
  616. vwxyz
  617. No match
  618. /(?<=abc|xy)123/
  619. abc12345
  620. 0: 123
  621. wxy123z
  622. 0: 123
  623. \= Expect no match
  624. 123abc
  625. No match
  626. /(?<!abc|xy)123/
  627. 123abc
  628. 0: 123
  629. mno123456
  630. 0: 123
  631. \= Expect no match
  632. abc12345
  633. No match
  634. wxy123z
  635. No match
  636. /abc(?C1)xyz/
  637. abcxyz
  638. --->abcxyz
  639. 1 ^ ^ x
  640. 0: abcxyz
  641. 123abcxyz999
  642. --->123abcxyz999
  643. 1 ^ ^ x
  644. 0: abcxyz
  645. /(ab|cd){3,4}/auto_callout
  646. ababab
  647. --->ababab
  648. +0 ^ (
  649. +1 ^ a
  650. +4 ^ c
  651. +2 ^^ b
  652. +3 ^ ^ |
  653. +1 ^ ^ a
  654. +4 ^ ^ c
  655. +2 ^ ^ b
  656. +3 ^ ^ |
  657. +1 ^ ^ a
  658. +4 ^ ^ c
  659. +2 ^ ^ b
  660. +3 ^ ^ |
  661. +12 ^ ^ End of pattern
  662. +1 ^ ^ a
  663. +4 ^ ^ c
  664. 0: ababab
  665. abcdabcd
  666. --->abcdabcd
  667. +0 ^ (
  668. +1 ^ a
  669. +4 ^ c
  670. +2 ^^ b
  671. +3 ^ ^ |
  672. +1 ^ ^ a
  673. +4 ^ ^ c
  674. +5 ^ ^ d
  675. +6 ^ ^ ){3,4}
  676. +1 ^ ^ a
  677. +4 ^ ^ c
  678. +2 ^ ^ b
  679. +3 ^ ^ |
  680. +12 ^ ^ End of pattern
  681. +1 ^ ^ a
  682. +4 ^ ^ c
  683. +5 ^ ^ d
  684. +6 ^ ^ ){3,4}
  685. +12 ^ ^ End of pattern
  686. 0: abcdabcd
  687. 1: abcdab
  688. abcdcdcdcdcd
  689. --->abcdcdcdcdcd
  690. +0 ^ (
  691. +1 ^ a
  692. +4 ^ c
  693. +2 ^^ b
  694. +3 ^ ^ |
  695. +1 ^ ^ a
  696. +4 ^ ^ c
  697. +5 ^ ^ d
  698. +6 ^ ^ ){3,4}
  699. +1 ^ ^ a
  700. +4 ^ ^ c
  701. +5 ^ ^ d
  702. +6 ^ ^ ){3,4}
  703. +12 ^ ^ End of pattern
  704. +1 ^ ^ a
  705. +4 ^ ^ c
  706. +5 ^ ^ d
  707. +6 ^ ^ ){3,4}
  708. +12 ^ ^ End of pattern
  709. 0: abcdcdcd
  710. 1: abcdcd
  711. /^abc/
  712. abcdef
  713. 0: abc
  714. \= Expect no match
  715. abcdef\=notbol
  716. No match
  717. /^(a*|xyz)/
  718. bcd
  719. 0:
  720. aaabcd
  721. 0: aaa
  722. xyz
  723. 0: xyz
  724. 1:
  725. xyz\=notempty
  726. 0: xyz
  727. \= Expect no match
  728. bcd\=notempty
  729. No match
  730. /xyz$/
  731. xyz
  732. 0: xyz
  733. xyz\n
  734. 0: xyz
  735. \= Expect no match
  736. xyz\=noteol
  737. No match
  738. xyz\n\=noteol
  739. No match
  740. /xyz$/m
  741. xyz
  742. 0: xyz
  743. xyz\n
  744. 0: xyz
  745. abcxyz\npqr
  746. 0: xyz
  747. abcxyz\npqr\=noteol
  748. 0: xyz
  749. xyz\n\=noteol
  750. 0: xyz
  751. \= Expect no match
  752. xyz\=noteol
  753. No match
  754. /\Gabc/
  755. abcdef
  756. 0: abc
  757. defabcxyz\=offset=3
  758. 0: abc
  759. \= Expect no match
  760. defabcxyz
  761. No match
  762. /^abcdef/
  763. ab\=ps
  764. Partial match: ab
  765. abcde\=ps
  766. Partial match: abcde
  767. abcdef\=ps
  768. 0: abcdef
  769. \= Expect no match
  770. abx\=ps
  771. No match
  772. /^a{2,4}\d+z/
  773. a\=ps
  774. Partial match: a
  775. aa\=ps
  776. Partial match: aa
  777. aa2\=ps
  778. Partial match: aa2
  779. aaa\=ps
  780. Partial match: aaa
  781. aaa23\=ps
  782. Partial match: aaa23
  783. aaaa12345\=ps
  784. Partial match: aaaa12345
  785. aa0z\=ps
  786. 0: aa0z
  787. aaaa4444444444444z\=ps
  788. 0: aaaa4444444444444z
  789. \= Expect no match
  790. az\=ps
  791. No match
  792. aaaaa\=ps
  793. No match
  794. a56\=ps
  795. No match
  796. /^abcdef/
  797. abc\=ps
  798. Partial match: abc
  799. def\=dfa_restart
  800. 0: def
  801. /(?<=foo)bar/
  802. foob\=ps,offset=2,allusedtext
  803. Partial match: foob
  804. <<<
  805. foobar...\=ps,dfa_restart,offset=4
  806. 0: ar
  807. foobar\=offset=2
  808. 0: bar
  809. \= Expect no match
  810. xyzfo\=ps
  811. No match
  812. obar\=dfa_restart
  813. No match
  814. /(ab*(cd|ef))+X/
  815. lkjhlkjhlkjhlkjhabbbbbbcdaefabbbbbbbefa\=ps,notbol,noteol
  816. Partial match: abbbbbbcdaefabbbbbbbefa
  817. cdabbbbbbbb\=ps,notbol,dfa_restart,noteol
  818. Partial match: cdabbbbbbbb
  819. efabbbbbbbbbbbbbbbb\=ps,notbol,dfa_restart,noteol
  820. Partial match: efabbbbbbbbbbbbbbbb
  821. bbbbbbbbbbbbcdXyasdfadf\=ps,notbol,dfa_restart,noteol
  822. 0: bbbbbbbbbbbbcdX
  823. \= Expect no match
  824. adfadadaklhlkalkajhlkjahdfasdfasdfladsfjkj\=ps,noteol
  825. No match
  826. /the quick brown fox/
  827. the quick brown fox
  828. 0: the quick brown fox
  829. What do you know about the quick brown fox?
  830. 0: the quick brown fox
  831. \= Expect no match
  832. The quick brown FOX
  833. No match
  834. What do you know about THE QUICK BROWN FOX?
  835. No match
  836. /The quick brown fox/i
  837. the quick brown fox
  838. 0: the quick brown fox
  839. The quick brown FOX
  840. 0: The quick brown FOX
  841. What do you know about the quick brown fox?
  842. 0: the quick brown fox
  843. What do you know about THE QUICK BROWN FOX?
  844. 0: THE QUICK BROWN FOX
  845. /abcd\t\n\r\f\a\e\071\x3b\$\\\?caxyz/
  846. abcd\t\n\r\f\a\e9;\$\\?caxyz
  847. 0: abcd\x09\x0a\x0d\x0c\x07\x1b9;$\?caxyz
  848. /a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/
  849. abxyzpqrrrabbxyyyypqAzz
  850. 0: abxyzpqrrrabbxyyyypqAzz
  851. abxyzpqrrrabbxyyyypqAzz
  852. 0: abxyzpqrrrabbxyyyypqAzz
  853. aabxyzpqrrrabbxyyyypqAzz
  854. 0: aabxyzpqrrrabbxyyyypqAzz
  855. aaabxyzpqrrrabbxyyyypqAzz
  856. 0: aaabxyzpqrrrabbxyyyypqAzz
  857. aaaabxyzpqrrrabbxyyyypqAzz
  858. 0: aaaabxyzpqrrrabbxyyyypqAzz
  859. abcxyzpqrrrabbxyyyypqAzz
  860. 0: abcxyzpqrrrabbxyyyypqAzz
  861. aabcxyzpqrrrabbxyyyypqAzz
  862. 0: aabcxyzpqrrrabbxyyyypqAzz
  863. aaabcxyzpqrrrabbxyyyypAzz
  864. 0: aaabcxyzpqrrrabbxyyyypAzz
  865. aaabcxyzpqrrrabbxyyyypqAzz
  866. 0: aaabcxyzpqrrrabbxyyyypqAzz
  867. aaabcxyzpqrrrabbxyyyypqqAzz
  868. 0: aaabcxyzpqrrrabbxyyyypqqAzz
  869. aaabcxyzpqrrrabbxyyyypqqqAzz
  870. 0: aaabcxyzpqrrrabbxyyyypqqqAzz
  871. aaabcxyzpqrrrabbxyyyypqqqqAzz
  872. 0: aaabcxyzpqrrrabbxyyyypqqqqAzz
  873. aaabcxyzpqrrrabbxyyyypqqqqqAzz
  874. 0: aaabcxyzpqrrrabbxyyyypqqqqqAzz
  875. aaabcxyzpqrrrabbxyyyypqqqqqqAzz
  876. 0: aaabcxyzpqrrrabbxyyyypqqqqqqAzz
  877. aaaabcxyzpqrrrabbxyyyypqAzz
  878. 0: aaaabcxyzpqrrrabbxyyyypqAzz
  879. abxyzzpqrrrabbxyyyypqAzz
  880. 0: abxyzzpqrrrabbxyyyypqAzz
  881. aabxyzzzpqrrrabbxyyyypqAzz
  882. 0: aabxyzzzpqrrrabbxyyyypqAzz
  883. aaabxyzzzzpqrrrabbxyyyypqAzz
  884. 0: aaabxyzzzzpqrrrabbxyyyypqAzz
  885. aaaabxyzzzzpqrrrabbxyyyypqAzz
  886. 0: aaaabxyzzzzpqrrrabbxyyyypqAzz
  887. abcxyzzpqrrrabbxyyyypqAzz
  888. 0: abcxyzzpqrrrabbxyyyypqAzz
  889. aabcxyzzzpqrrrabbxyyyypqAzz
  890. 0: aabcxyzzzpqrrrabbxyyyypqAzz
  891. aaabcxyzzzzpqrrrabbxyyyypqAzz
  892. 0: aaabcxyzzzzpqrrrabbxyyyypqAzz
  893. aaaabcxyzzzzpqrrrabbxyyyypqAzz
  894. 0: aaaabcxyzzzzpqrrrabbxyyyypqAzz
  895. aaaabcxyzzzzpqrrrabbbxyyyypqAzz
  896. 0: aaaabcxyzzzzpqrrrabbbxyyyypqAzz
  897. aaaabcxyzzzzpqrrrabbbxyyyyypqAzz
  898. 0: aaaabcxyzzzzpqrrrabbbxyyyyypqAzz
  899. aaabcxyzpqrrrabbxyyyypABzz
  900. 0: aaabcxyzpqrrrabbxyyyypABzz
  901. aaabcxyzpqrrrabbxyyyypABBzz
  902. 0: aaabcxyzpqrrrabbxyyyypABBzz
  903. >>>aaabxyzpqrrrabbxyyyypqAzz
  904. 0: aaabxyzpqrrrabbxyyyypqAzz
  905. >aaaabxyzpqrrrabbxyyyypqAzz
  906. 0: aaaabxyzpqrrrabbxyyyypqAzz
  907. >>>>abcxyzpqrrrabbxyyyypqAzz
  908. 0: abcxyzpqrrrabbxyyyypqAzz
  909. \= Expect no match
  910. abxyzpqrrabbxyyyypqAzz
  911. No match
  912. abxyzpqrrrrabbxyyyypqAzz
  913. No match
  914. abxyzpqrrrabxyyyypqAzz
  915. No match
  916. aaaabcxyzzzzpqrrrabbbxyyyyyypqAzz
  917. No match
  918. aaaabcxyzzzzpqrrrabbbxyyypqAzz
  919. No match
  920. aaabcxyzpqrrrabbxyyyypqqqqqqqAzz
  921. No match
  922. /^(abc){1,2}zz/
  923. abczz
  924. 0: abczz
  925. abcabczz
  926. 0: abcabczz
  927. \= Expect no match
  928. zz
  929. No match
  930. abcabcabczz
  931. No match
  932. >>abczz
  933. No match
  934. /^(b+?|a){1,2}?c/
  935. bc
  936. 0: bc
  937. bbc
  938. 0: bbc
  939. bbbc
  940. 0: bbbc
  941. bac
  942. 0: bac
  943. bbac
  944. 0: bbac
  945. aac
  946. 0: aac
  947. abbbbbbbbbbbc
  948. 0: abbbbbbbbbbbc
  949. bbbbbbbbbbbac
  950. 0: bbbbbbbbbbbac
  951. \= Expect no match
  952. aaac
  953. No match
  954. abbbbbbbbbbbac
  955. No match
  956. /^(b+|a){1,2}c/
  957. bc
  958. 0: bc
  959. bbc
  960. 0: bbc
  961. bbbc
  962. 0: bbbc
  963. bac
  964. 0: bac
  965. bbac
  966. 0: bbac
  967. aac
  968. 0: aac
  969. abbbbbbbbbbbc
  970. 0: abbbbbbbbbbbc
  971. bbbbbbbbbbbac
  972. 0: bbbbbbbbbbbac
  973. \= Expect no match
  974. aaac
  975. No match
  976. abbbbbbbbbbbac
  977. No match
  978. /^(b+|a){1,2}?bc/
  979. bbc
  980. 0: bbc
  981. /^(b*|ba){1,2}?bc/
  982. babc
  983. 0: babc
  984. bbabc
  985. 0: bbabc
  986. bababc
  987. 0: bababc
  988. \= Expect no match
  989. bababbc
  990. No match
  991. babababc
  992. No match
  993. /^(ba|b*){1,2}?bc/
  994. babc
  995. 0: babc
  996. bbabc
  997. 0: bbabc
  998. bababc
  999. 0: bababc
  1000. \= Expect no match
  1001. bababbc
  1002. No match
  1003. babababc
  1004. No match
  1005. /^\ca\cA\c[\c{\c:/
  1006. \x01\x01\e;z
  1007. 0: \x01\x01\x1b;z
  1008. /^[ab\]cde]/
  1009. athing
  1010. 0: a
  1011. bthing
  1012. 0: b
  1013. ]thing
  1014. 0: ]
  1015. cthing
  1016. 0: c
  1017. dthing
  1018. 0: d
  1019. ething
  1020. 0: e
  1021. \= Expect no match
  1022. fthing
  1023. No match
  1024. [thing
  1025. No match
  1026. \\thing
  1027. No match
  1028. /^[]cde]/
  1029. ]thing
  1030. 0: ]
  1031. cthing
  1032. 0: c
  1033. dthing
  1034. 0: d
  1035. ething
  1036. 0: e
  1037. \= Expect no match
  1038. athing
  1039. No match
  1040. fthing
  1041. No match
  1042. /^[^ab\]cde]/
  1043. fthing
  1044. 0: f
  1045. [thing
  1046. 0: [
  1047. \\thing
  1048. 0: \
  1049. \= Expect no match
  1050. athing
  1051. No match
  1052. bthing
  1053. No match
  1054. ]thing
  1055. No match
  1056. cthing
  1057. No match
  1058. dthing
  1059. No match
  1060. ething
  1061. No match
  1062. /^[^]cde]/
  1063. athing
  1064. 0: a
  1065. fthing
  1066. 0: f
  1067. \= Expect no match
  1068. ]thing
  1069. No match
  1070. cthing
  1071. No match
  1072. dthing
  1073. No match
  1074. ething
  1075. No match
  1076. /^\�/
  1077. 0: \x81
  1078. /^ÿ/
  1079. ÿ
  1080. 0: \xff
  1081. /^[0-9]+$/
  1082. 0
  1083. 0: 0
  1084. 1
  1085. 0: 1
  1086. 2
  1087. 0: 2
  1088. 3
  1089. 0: 3
  1090. 4
  1091. 0: 4
  1092. 5
  1093. 0: 5
  1094. 6
  1095. 0: 6
  1096. 7
  1097. 0: 7
  1098. 8
  1099. 0: 8
  1100. 9
  1101. 0: 9
  1102. 10
  1103. 0: 10
  1104. 100
  1105. 0: 100
  1106. \= Expect no match
  1107. abc
  1108. No match
  1109. /^.*nter/
  1110. enter
  1111. 0: enter
  1112. inter
  1113. 0: inter
  1114. uponter
  1115. 0: uponter
  1116. /^xxx[0-9]+$/
  1117. xxx0
  1118. 0: xxx0
  1119. xxx1234
  1120. 0: xxx1234
  1121. \= Expect no match
  1122. xxx
  1123. No match
  1124. /^.+[0-9][0-9][0-9]$/
  1125. x123
  1126. 0: x123
  1127. xx123
  1128. 0: xx123
  1129. 123456
  1130. 0: 123456
  1131. x1234
  1132. 0: x1234
  1133. \= Expect no match
  1134. 123
  1135. No match
  1136. /^.+?[0-9][0-9][0-9]$/
  1137. x123
  1138. 0: x123
  1139. xx123
  1140. 0: xx123
  1141. 123456
  1142. 0: 123456
  1143. x1234
  1144. 0: x1234
  1145. \= Expect no match
  1146. 123
  1147. No match
  1148. /^([^!]+)!(.+)=apquxz\.ixr\.zzz\.ac\.uk$/
  1149. abc!pqr=apquxz.ixr.zzz.ac.uk
  1150. 0: abc!pqr=apquxz.ixr.zzz.ac.uk
  1151. \= Expect no match
  1152. !pqr=apquxz.ixr.zzz.ac.uk
  1153. No match
  1154. abc!=apquxz.ixr.zzz.ac.uk
  1155. No match
  1156. abc!pqr=apquxz:ixr.zzz.ac.uk
  1157. No match
  1158. abc!pqr=apquxz.ixr.zzz.ac.ukk
  1159. No match
  1160. /:/
  1161. Well, we need a colon: somewhere
  1162. 0: :
  1163. \= Expect no match
  1164. No match without a colon
  1165. No match
  1166. /([\da-f:]+)$/i
  1167. 0abc
  1168. 0: 0abc
  1169. abc
  1170. 0: abc
  1171. fed
  1172. 0: fed
  1173. E
  1174. 0: E
  1175. ::
  1176. 0: ::
  1177. 5f03:12C0::932e
  1178. 0: 5f03:12C0::932e
  1179. fed def
  1180. 0: def
  1181. Any old stuff
  1182. 0: ff
  1183. \= Expect no match
  1184. 0zzz
  1185. No match
  1186. gzzz
  1187. No match
  1188. fed\x20
  1189. No match
  1190. Any old rubbish
  1191. No match
  1192. /^.*\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/
  1193. .1.2.3
  1194. 0: .1.2.3
  1195. A.12.123.0
  1196. 0: A.12.123.0
  1197. \= Expect no match
  1198. .1.2.3333
  1199. No match
  1200. 1.2.3
  1201. No match
  1202. 1234.2.3
  1203. No match
  1204. /^(\d+)\s+IN\s+SOA\s+(\S+)\s+(\S+)\s*\(\s*$/
  1205. 1 IN SOA non-sp1 non-sp2(
  1206. 0: 1 IN SOA non-sp1 non-sp2(
  1207. 1 IN SOA non-sp1 non-sp2 (
  1208. 0: 1 IN SOA non-sp1 non-sp2 (
  1209. \= Expect no match
  1210. 1IN SOA non-sp1 non-sp2(
  1211. No match
  1212. /^[a-zA-Z\d][a-zA-Z\d\-]*(\.[a-zA-Z\d][a-zA-z\d\-]*)*\.$/
  1213. a.
  1214. 0: a.
  1215. Z.
  1216. 0: Z.
  1217. 2.
  1218. 0: 2.
  1219. ab-c.pq-r.
  1220. 0: ab-c.pq-r.
  1221. sxk.zzz.ac.uk.
  1222. 0: sxk.zzz.ac.uk.
  1223. x-.y-.
  1224. 0: x-.y-.
  1225. \= Expect no match
  1226. -abc.peq.
  1227. No match
  1228. /^\*\.[a-z]([a-z\-\d]*[a-z\d]+)?(\.[a-z]([a-z\-\d]*[a-z\d]+)?)*$/
  1229. *.a
  1230. 0: *.a
  1231. *.b0-a
  1232. 0: *.b0-a
  1233. *.c3-b.c
  1234. 0: *.c3-b.c
  1235. *.c-a.b-c
  1236. 0: *.c-a.b-c
  1237. \= Expect no match
  1238. *.0
  1239. No match
  1240. *.a-
  1241. No match
  1242. *.a-b.c-
  1243. No match
  1244. *.c-a.0-c
  1245. No match
  1246. /^(?=ab(de))(abd)(e)/
  1247. abde
  1248. 0: abde
  1249. /^(?!(ab)de|x)(abd)(f)/
  1250. abdf
  1251. 0: abdf
  1252. /^(?=(ab(cd)))(ab)/
  1253. abcd
  1254. 0: ab
  1255. /^[\da-f](\.[\da-f])*$/i
  1256. a.b.c.d
  1257. 0: a.b.c.d
  1258. A.B.C.D
  1259. 0: A.B.C.D
  1260. a.b.c.1.2.3.C
  1261. 0: a.b.c.1.2.3.C
  1262. /^\".*\"\s*(;.*)?$/
  1263. \"1234\"
  1264. 0: "1234"
  1265. \"abcd\" ;
  1266. 0: "abcd" ;
  1267. \"\" ; rhubarb
  1268. 0: "" ; rhubarb
  1269. \= Expect no match
  1270. \"1234\" : things
  1271. No match
  1272. /^$/
  1273. \
  1274. 0:
  1275. / ^ a (?# begins with a) b\sc (?# then b c) $ (?# then end)/x
  1276. ab c
  1277. 0: ab c
  1278. \= Expect no match
  1279. abc
  1280. No match
  1281. ab cde
  1282. No match
  1283. /(?x) ^ a (?# begins with a) b\sc (?# then b c) $ (?# then end)/
  1284. ab c
  1285. 0: ab c
  1286. \= Expect no match
  1287. abc
  1288. No match
  1289. ab cde
  1290. No match
  1291. /^ a\ b[c ]d $/x
  1292. a bcd
  1293. 0: a bcd
  1294. a b d
  1295. 0: a b d
  1296. \= Expect no match
  1297. abcd
  1298. No match
  1299. ab d
  1300. No match
  1301. /^(a(b(c)))(d(e(f)))(h(i(j)))(k(l(m)))$/
  1302. abcdefhijklm
  1303. 0: abcdefhijklm
  1304. /^(?:a(b(c)))(?:d(e(f)))(?:h(i(j)))(?:k(l(m)))$/
  1305. abcdefhijklm
  1306. 0: abcdefhijklm
  1307. /^[\w][\W][\s][\S][\d][\D][\b][\n][\c]][\022]/
  1308. a+ Z0+\x08\n\x1d\x12
  1309. 0: a+ Z0+\x08\x0a\x1d\x12
  1310. /^[.^$|()*+?{,}]+/
  1311. .^\$(*+)|{?,?}
  1312. 0: .^$(*+)|{?,?}
  1313. /^a*\w/
  1314. z
  1315. 0: z
  1316. az
  1317. 0: az
  1318. 1: a
  1319. aaaz
  1320. 0: aaaz
  1321. 1: aaa
  1322. 2: aa
  1323. 3: a
  1324. a
  1325. 0: a
  1326. aa
  1327. 0: aa
  1328. 1: a
  1329. aaaa
  1330. 0: aaaa
  1331. 1: aaa
  1332. 2: aa
  1333. 3: a
  1334. a+
  1335. 0: a
  1336. aa+
  1337. 0: aa
  1338. 1: a
  1339. /^a*?\w/
  1340. z
  1341. 0: z
  1342. az
  1343. 0: az
  1344. 1: a
  1345. aaaz
  1346. 0: aaaz
  1347. 1: aaa
  1348. 2: aa
  1349. 3: a
  1350. a
  1351. 0: a
  1352. aa
  1353. 0: aa
  1354. 1: a
  1355. aaaa
  1356. 0: aaaa
  1357. 1: aaa
  1358. 2: aa
  1359. 3: a
  1360. a+
  1361. 0: a
  1362. aa+
  1363. 0: aa
  1364. 1: a
  1365. /^a+\w/
  1366. az
  1367. 0: az
  1368. aaaz
  1369. 0: aaaz
  1370. 1: aaa
  1371. 2: aa
  1372. aa
  1373. 0: aa
  1374. aaaa
  1375. 0: aaaa
  1376. 1: aaa
  1377. 2: aa
  1378. aa+
  1379. 0: aa
  1380. /^a+?\w/
  1381. az
  1382. 0: az
  1383. aaaz
  1384. 0: aaaz
  1385. 1: aaa
  1386. 2: aa
  1387. aa
  1388. 0: aa
  1389. aaaa
  1390. 0: aaaa
  1391. 1: aaa
  1392. 2: aa
  1393. aa+
  1394. 0: aa
  1395. /^\d{8}\w{2,}/
  1396. 1234567890
  1397. 0: 1234567890
  1398. 12345678ab
  1399. 0: 12345678ab
  1400. 12345678__
  1401. 0: 12345678__
  1402. \= Expect no match
  1403. 1234567
  1404. No match
  1405. /^[aeiou\d]{4,5}$/
  1406. uoie
  1407. 0: uoie
  1408. 1234
  1409. 0: 1234
  1410. 12345
  1411. 0: 12345
  1412. aaaaa
  1413. 0: aaaaa
  1414. \= Expect no match
  1415. 123456
  1416. No match
  1417. /^[aeiou\d]{4,5}?/
  1418. uoie
  1419. 0: uoie
  1420. 1234
  1421. 0: 1234
  1422. 12345
  1423. 0: 12345
  1424. 1: 1234
  1425. aaaaa
  1426. 0: aaaaa
  1427. 1: aaaa
  1428. 123456
  1429. 0: 12345
  1430. 1: 1234
  1431. /^From +([^ ]+) +[a-zA-Z][a-zA-Z][a-zA-Z] +[a-zA-Z][a-zA-Z][a-zA-Z] +[0-9]?[0-9] +[0-9][0-9]:[0-9][0-9]/
  1432. From abcd Mon Sep 01 12:33:02 1997
  1433. 0: From abcd Mon Sep 01 12:33
  1434. /^From\s+\S+\s+([a-zA-Z]{3}\s+){2}\d{1,2}\s+\d\d:\d\d/
  1435. From abcd Mon Sep 01 12:33:02 1997
  1436. 0: From abcd Mon Sep 01 12:33
  1437. From abcd Mon Sep 1 12:33:02 1997
  1438. 0: From abcd Mon Sep 1 12:33
  1439. \= Expect no match
  1440. From abcd Sep 01 12:33:02 1997
  1441. No match
  1442. /^12.34/s
  1443. 12\n34
  1444. 0: 12\x0a34
  1445. 12\r34
  1446. 0: 12\x0d34
  1447. /\w+(?=\t)/
  1448. the quick brown\t fox
  1449. 0: brown
  1450. /foo(?!bar)(.*)/
  1451. foobar is foolish see?
  1452. 0: foolish see?
  1453. /(?:(?!foo)...|^.{0,2})bar(.*)/
  1454. foobar crowbar etc
  1455. 0: rowbar etc
  1456. barrel
  1457. 0: barrel
  1458. 2barrel
  1459. 0: 2barrel
  1460. A barrel
  1461. 0: A barrel
  1462. /^(\D*)(?=\d)(?!123)/
  1463. abc456
  1464. 0: abc
  1465. \= Expect no match
  1466. abc123
  1467. No match
  1468. /^1234(?# test newlines
  1469. inside)/
  1470. 1234
  1471. 0: 1234
  1472. /^1234 #comment in extended re
  1473. /x
  1474. 1234
  1475. 0: 1234
  1476. /#rhubarb
  1477. abcd/x
  1478. abcd
  1479. 0: abcd
  1480. /^abcd#rhubarb/x
  1481. abcd
  1482. 0: abcd
  1483. /(?!^)abc/
  1484. the abc
  1485. 0: abc
  1486. \= Expect no match
  1487. abc
  1488. No match
  1489. /(?=^)abc/
  1490. abc
  1491. 0: abc
  1492. \= Expect no match
  1493. the abc
  1494. No match
  1495. /^[ab]{1,3}(ab*|b)/no_auto_possess
  1496. aabbbbb
  1497. 0: aabbbbb
  1498. 1: aabbbb
  1499. 2: aabbb
  1500. 3: aabb
  1501. 4: aab
  1502. 5: aa
  1503. /^[ab]{1,3}?(ab*|b)/no_auto_possess
  1504. aabbbbb
  1505. 0: aabbbbb
  1506. 1: aabbbb
  1507. 2: aabbb
  1508. 3: aabb
  1509. 4: aab
  1510. 5: aa
  1511. /^[ab]{1,3}?(ab*?|b)/no_auto_possess
  1512. aabbbbb
  1513. 0: aabbbbb
  1514. 1: aabbbb
  1515. 2: aabbb
  1516. 3: aabb
  1517. 4: aab
  1518. 5: aa
  1519. /^[ab]{1,3}(ab*?|b)/no_auto_possess
  1520. aabbbbb
  1521. 0: aabbbbb
  1522. 1: aabbbb
  1523. 2: aabbb
  1524. 3: aabb
  1525. 4: aab
  1526. 5: aa
  1527. / (?: [\040\t] | \(
  1528. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  1529. \) )* # optional leading comment
  1530. (?: (?:
  1531. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  1532. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  1533. |
  1534. " (?: # opening quote...
  1535. [^\\\x80-\xff\n\015"] # Anything except backslash and quote
  1536. | # or
  1537. \\ [^\x80-\xff] # Escaped something (something != CR)
  1538. )* " # closing quote
  1539. ) # initial word
  1540. (?: (?: [\040\t] | \(
  1541. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  1542. \) )* \. (?: [\040\t] | \(
  1543. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  1544. \) )* (?:
  1545. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  1546. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  1547. |
  1548. " (?: # opening quote...
  1549. [^\\\x80-\xff\n\015"] # Anything except backslash and quote
  1550. | # or
  1551. \\ [^\x80-\xff] # Escaped something (something != CR)
  1552. )* " # closing quote
  1553. ) )* # further okay, if led by a period
  1554. (?: [\040\t] | \(
  1555. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  1556. \) )* @ (?: [\040\t] | \(
  1557. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  1558. \) )* (?:
  1559. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  1560. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  1561. | \[ # [
  1562. (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
  1563. \] # ]
  1564. ) # initial subdomain
  1565. (?: #
  1566. (?: [\040\t] | \(
  1567. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  1568. \) )* \. # if led by a period...
  1569. (?: [\040\t] | \(
  1570. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  1571. \) )* (?:
  1572. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  1573. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  1574. | \[ # [
  1575. (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
  1576. \] # ]
  1577. ) # ...further okay
  1578. )*
  1579. # address
  1580. | # or
  1581. (?:
  1582. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  1583. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  1584. |
  1585. " (?: # opening quote...
  1586. [^\\\x80-\xff\n\015"] # Anything except backslash and quote
  1587. | # or
  1588. \\ [^\x80-\xff] # Escaped something (something != CR)
  1589. )* " # closing quote
  1590. ) # one word, optionally followed by....
  1591. (?:
  1592. [^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037] | # atom and space parts, or...
  1593. \(
  1594. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  1595. \) | # comments, or...
  1596. " (?: # opening quote...
  1597. [^\\\x80-\xff\n\015"] # Anything except backslash and quote
  1598. | # or
  1599. \\ [^\x80-\xff] # Escaped something (something != CR)
  1600. )* " # closing quote
  1601. # quoted strings
  1602. )*
  1603. < (?: [\040\t] | \(
  1604. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  1605. \) )* # leading <
  1606. (?: @ (?: [\040\t] | \(
  1607. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  1608. \) )* (?:
  1609. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  1610. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  1611. | \[ # [
  1612. (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
  1613. \] # ]
  1614. ) # initial subdomain
  1615. (?: #
  1616. (?: [\040\t] | \(
  1617. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  1618. \) )* \. # if led by a period...
  1619. (?: [\040\t] | \(
  1620. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  1621. \) )* (?:
  1622. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  1623. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  1624. | \[ # [
  1625. (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
  1626. \] # ]
  1627. ) # ...further okay
  1628. )*
  1629. (?: (?: [\040\t] | \(
  1630. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  1631. \) )* , (?: [\040\t] | \(
  1632. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  1633. \) )* @ (?: [\040\t] | \(
  1634. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  1635. \) )* (?:
  1636. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  1637. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  1638. | \[ # [
  1639. (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
  1640. \] # ]
  1641. ) # initial subdomain
  1642. (?: #
  1643. (?: [\040\t] | \(
  1644. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  1645. \) )* \. # if led by a period...
  1646. (?: [\040\t] | \(
  1647. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  1648. \) )* (?:
  1649. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  1650. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  1651. | \[ # [
  1652. (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
  1653. \] # ]
  1654. ) # ...further okay
  1655. )*
  1656. )* # further okay, if led by comma
  1657. : # closing colon
  1658. (?: [\040\t] | \(
  1659. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  1660. \) )* )? # optional route
  1661. (?:
  1662. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  1663. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  1664. |
  1665. " (?: # opening quote...
  1666. [^\\\x80-\xff\n\015"] # Anything except backslash and quote
  1667. | # or
  1668. \\ [^\x80-\xff] # Escaped something (something != CR)
  1669. )* " # closing quote
  1670. ) # initial word
  1671. (?: (?: [\040\t] | \(
  1672. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  1673. \) )* \. (?: [\040\t] | \(
  1674. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  1675. \) )* (?:
  1676. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  1677. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  1678. |
  1679. " (?: # opening quote...
  1680. [^\\\x80-\xff\n\015"] # Anything except backslash and quote
  1681. | # or
  1682. \\ [^\x80-\xff] # Escaped something (something != CR)
  1683. )* " # closing quote
  1684. ) )* # further okay, if led by a period
  1685. (?: [\040\t] | \(
  1686. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  1687. \) )* @ (?: [\040\t] | \(
  1688. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  1689. \) )* (?:
  1690. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  1691. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  1692. | \[ # [
  1693. (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
  1694. \] # ]
  1695. ) # initial subdomain
  1696. (?: #
  1697. (?: [\040\t] | \(
  1698. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  1699. \) )* \. # if led by a period...
  1700. (?: [\040\t] | \(
  1701. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  1702. \) )* (?:
  1703. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  1704. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  1705. | \[ # [
  1706. (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
  1707. \] # ]
  1708. ) # ...further okay
  1709. )*
  1710. # address spec
  1711. (?: [\040\t] | \(
  1712. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  1713. \) )* > # trailing >
  1714. # name and address
  1715. ) (?: [\040\t] | \(
  1716. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  1717. \) )* # optional trailing comment
  1718. /x
  1719. Alan Other <user\@dom.ain>
  1720. 0: Alan Other <[email protected]>
  1721. <user\@dom.ain>
  1722. 0: [email protected]
  1723. 1: user@dom
  1724. user\@dom.ain
  1725. 0: [email protected]
  1726. 1: user@dom
  1727. \"A. Other\" <user.1234\@dom.ain> (a comment)
  1728. 0: "A. Other" <[email protected]> (a comment)
  1729. 1: "A. Other" <[email protected]>
  1730. 2: "A. Other" <[email protected]>
  1731. A. Other <user.1234\@dom.ain> (a comment)
  1732. 0: Other <[email protected]> (a comment)
  1733. 1: Other <[email protected]>
  1734. 2: Other <[email protected]>
  1735. \"/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/\"\@x400-re.lay
  1736. 0: "/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/"@x400-re.lay
  1737. 1: "/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/"@x400-re
  1738. A missing angle <user\@some.where
  1739. 0: [email protected]
  1740. 1: user@some
  1741. \= Expect no match
  1742. The quick brown fox
  1743. No match
  1744. /[\040\t]* # Nab whitespace.
  1745. (?:
  1746. \( # (
  1747. [^\\\x80-\xff\n\015()] * # normal*
  1748. (?: # (
  1749. (?: \\ [^\x80-\xff] |
  1750. \( # (
  1751. [^\\\x80-\xff\n\015()] * # normal*
  1752. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  1753. \) # )
  1754. ) # special
  1755. [^\\\x80-\xff\n\015()] * # normal*
  1756. )* # )*
  1757. \) # )
  1758. [\040\t]* )* # If comment found, allow more spaces.
  1759. # optional leading comment
  1760. (?:
  1761. (?:
  1762. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  1763. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  1764. # Atom
  1765. | # or
  1766. " # "
  1767. [^\\\x80-\xff\n\015"] * # normal
  1768. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )*
  1769. " # "
  1770. # Quoted string
  1771. )
  1772. [\040\t]* # Nab whitespace.
  1773. (?:
  1774. \( # (
  1775. [^\\\x80-\xff\n\015()] * # normal*
  1776. (?: # (
  1777. (?: \\ [^\x80-\xff] |
  1778. \( # (
  1779. [^\\\x80-\xff\n\015()] * # normal*
  1780. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  1781. \) # )
  1782. ) # special
  1783. [^\\\x80-\xff\n\015()] * # normal*
  1784. )* # )*
  1785. \) # )
  1786. [\040\t]* )* # If comment found, allow more spaces.
  1787. (?:
  1788. \.
  1789. [\040\t]* # Nab whitespace.
  1790. (?:
  1791. \( # (
  1792. [^\\\x80-\xff\n\015()] * # normal*
  1793. (?: # (
  1794. (?: \\ [^\x80-\xff] |
  1795. \( # (
  1796. [^\\\x80-\xff\n\015()] * # normal*
  1797. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  1798. \) # )
  1799. ) # special
  1800. [^\\\x80-\xff\n\015()] * # normal*
  1801. )* # )*
  1802. \) # )
  1803. [\040\t]* )* # If comment found, allow more spaces.
  1804. (?:
  1805. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  1806. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  1807. # Atom
  1808. | # or
  1809. " # "
  1810. [^\\\x80-\xff\n\015"] * # normal
  1811. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )*
  1812. " # "
  1813. # Quoted string
  1814. )
  1815. [\040\t]* # Nab whitespace.
  1816. (?:
  1817. \( # (
  1818. [^\\\x80-\xff\n\015()] * # normal*
  1819. (?: # (
  1820. (?: \\ [^\x80-\xff] |
  1821. \( # (
  1822. [^\\\x80-\xff\n\015()] * # normal*
  1823. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  1824. \) # )
  1825. ) # special
  1826. [^\\\x80-\xff\n\015()] * # normal*
  1827. )* # )*
  1828. \) # )
  1829. [\040\t]* )* # If comment found, allow more spaces.
  1830. # additional words
  1831. )*
  1832. @
  1833. [\040\t]* # Nab whitespace.
  1834. (?:
  1835. \( # (
  1836. [^\\\x80-\xff\n\015()] * # normal*
  1837. (?: # (
  1838. (?: \\ [^\x80-\xff] |
  1839. \( # (
  1840. [^\\\x80-\xff\n\015()] * # normal*
  1841. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  1842. \) # )
  1843. ) # special
  1844. [^\\\x80-\xff\n\015()] * # normal*
  1845. )* # )*
  1846. \) # )
  1847. [\040\t]* )* # If comment found, allow more spaces.
  1848. (?:
  1849. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  1850. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  1851. |
  1852. \[ # [
  1853. (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
  1854. \] # ]
  1855. )
  1856. [\040\t]* # Nab whitespace.
  1857. (?:
  1858. \( # (
  1859. [^\\\x80-\xff\n\015()] * # normal*
  1860. (?: # (
  1861. (?: \\ [^\x80-\xff] |
  1862. \( # (
  1863. [^\\\x80-\xff\n\015()] * # normal*
  1864. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  1865. \) # )
  1866. ) # special
  1867. [^\\\x80-\xff\n\015()] * # normal*
  1868. )* # )*
  1869. \) # )
  1870. [\040\t]* )* # If comment found, allow more spaces.
  1871. # optional trailing comments
  1872. (?:
  1873. \.
  1874. [\040\t]* # Nab whitespace.
  1875. (?:
  1876. \( # (
  1877. [^\\\x80-\xff\n\015()] * # normal*
  1878. (?: # (
  1879. (?: \\ [^\x80-\xff] |
  1880. \( # (
  1881. [^\\\x80-\xff\n\015()] * # normal*
  1882. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  1883. \) # )
  1884. ) # special
  1885. [^\\\x80-\xff\n\015()] * # normal*
  1886. )* # )*
  1887. \) # )
  1888. [\040\t]* )* # If comment found, allow more spaces.
  1889. (?:
  1890. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  1891. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  1892. |
  1893. \[ # [
  1894. (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
  1895. \] # ]
  1896. )
  1897. [\040\t]* # Nab whitespace.
  1898. (?:
  1899. \( # (
  1900. [^\\\x80-\xff\n\015()] * # normal*
  1901. (?: # (
  1902. (?: \\ [^\x80-\xff] |
  1903. \( # (
  1904. [^\\\x80-\xff\n\015()] * # normal*
  1905. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  1906. \) # )
  1907. ) # special
  1908. [^\\\x80-\xff\n\015()] * # normal*
  1909. )* # )*
  1910. \) # )
  1911. [\040\t]* )* # If comment found, allow more spaces.
  1912. # optional trailing comments
  1913. )*
  1914. # address
  1915. | # or
  1916. (?:
  1917. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  1918. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  1919. # Atom
  1920. | # or
  1921. " # "
  1922. [^\\\x80-\xff\n\015"] * # normal
  1923. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )*
  1924. " # "
  1925. # Quoted string
  1926. )
  1927. # leading word
  1928. [^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037] * # "normal" atoms and or spaces
  1929. (?:
  1930. (?:
  1931. \( # (
  1932. [^\\\x80-\xff\n\015()] * # normal*
  1933. (?: # (
  1934. (?: \\ [^\x80-\xff] |
  1935. \( # (
  1936. [^\\\x80-\xff\n\015()] * # normal*
  1937. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  1938. \) # )
  1939. ) # special
  1940. [^\\\x80-\xff\n\015()] * # normal*
  1941. )* # )*
  1942. \) # )
  1943. |
  1944. " # "
  1945. [^\\\x80-\xff\n\015"] * # normal
  1946. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )*
  1947. " # "
  1948. ) # "special" comment or quoted string
  1949. [^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037] * # more "normal"
  1950. )*
  1951. <
  1952. [\040\t]* # Nab whitespace.
  1953. (?:
  1954. \( # (
  1955. [^\\\x80-\xff\n\015()] * # normal*
  1956. (?: # (
  1957. (?: \\ [^\x80-\xff] |
  1958. \( # (
  1959. [^\\\x80-\xff\n\015()] * # normal*
  1960. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  1961. \) # )
  1962. ) # special
  1963. [^\\\x80-\xff\n\015()] * # normal*
  1964. )* # )*
  1965. \) # )
  1966. [\040\t]* )* # If comment found, allow more spaces.
  1967. # <
  1968. (?:
  1969. @
  1970. [\040\t]* # Nab whitespace.
  1971. (?:
  1972. \( # (
  1973. [^\\\x80-\xff\n\015()] * # normal*
  1974. (?: # (
  1975. (?: \\ [^\x80-\xff] |
  1976. \( # (
  1977. [^\\\x80-\xff\n\015()] * # normal*
  1978. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  1979. \) # )
  1980. ) # special
  1981. [^\\\x80-\xff\n\015()] * # normal*
  1982. )* # )*
  1983. \) # )
  1984. [\040\t]* )* # If comment found, allow more spaces.
  1985. (?:
  1986. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  1987. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  1988. |
  1989. \[ # [
  1990. (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
  1991. \] # ]
  1992. )
  1993. [\040\t]* # Nab whitespace.
  1994. (?:
  1995. \( # (
  1996. [^\\\x80-\xff\n\015()] * # normal*
  1997. (?: # (
  1998. (?: \\ [^\x80-\xff] |
  1999. \( # (
  2000. [^\\\x80-\xff\n\015()] * # normal*
  2001. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  2002. \) # )
  2003. ) # special
  2004. [^\\\x80-\xff\n\015()] * # normal*
  2005. )* # )*
  2006. \) # )
  2007. [\040\t]* )* # If comment found, allow more spaces.
  2008. # optional trailing comments
  2009. (?:
  2010. \.
  2011. [\040\t]* # Nab whitespace.
  2012. (?:
  2013. \( # (
  2014. [^\\\x80-\xff\n\015()] * # normal*
  2015. (?: # (
  2016. (?: \\ [^\x80-\xff] |
  2017. \( # (
  2018. [^\\\x80-\xff\n\015()] * # normal*
  2019. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  2020. \) # )
  2021. ) # special
  2022. [^\\\x80-\xff\n\015()] * # normal*
  2023. )* # )*
  2024. \) # )
  2025. [\040\t]* )* # If comment found, allow more spaces.
  2026. (?:
  2027. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  2028. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  2029. |
  2030. \[ # [
  2031. (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
  2032. \] # ]
  2033. )
  2034. [\040\t]* # Nab whitespace.
  2035. (?:
  2036. \( # (
  2037. [^\\\x80-\xff\n\015()] * # normal*
  2038. (?: # (
  2039. (?: \\ [^\x80-\xff] |
  2040. \( # (
  2041. [^\\\x80-\xff\n\015()] * # normal*
  2042. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  2043. \) # )
  2044. ) # special
  2045. [^\\\x80-\xff\n\015()] * # normal*
  2046. )* # )*
  2047. \) # )
  2048. [\040\t]* )* # If comment found, allow more spaces.
  2049. # optional trailing comments
  2050. )*
  2051. (?: ,
  2052. [\040\t]* # Nab whitespace.
  2053. (?:
  2054. \( # (
  2055. [^\\\x80-\xff\n\015()] * # normal*
  2056. (?: # (
  2057. (?: \\ [^\x80-\xff] |
  2058. \( # (
  2059. [^\\\x80-\xff\n\015()] * # normal*
  2060. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  2061. \) # )
  2062. ) # special
  2063. [^\\\x80-\xff\n\015()] * # normal*
  2064. )* # )*
  2065. \) # )
  2066. [\040\t]* )* # If comment found, allow more spaces.
  2067. @
  2068. [\040\t]* # Nab whitespace.
  2069. (?:
  2070. \( # (
  2071. [^\\\x80-\xff\n\015()] * # normal*
  2072. (?: # (
  2073. (?: \\ [^\x80-\xff] |
  2074. \( # (
  2075. [^\\\x80-\xff\n\015()] * # normal*
  2076. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  2077. \) # )
  2078. ) # special
  2079. [^\\\x80-\xff\n\015()] * # normal*
  2080. )* # )*
  2081. \) # )
  2082. [\040\t]* )* # If comment found, allow more spaces.
  2083. (?:
  2084. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  2085. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  2086. |
  2087. \[ # [
  2088. (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
  2089. \] # ]
  2090. )
  2091. [\040\t]* # Nab whitespace.
  2092. (?:
  2093. \( # (
  2094. [^\\\x80-\xff\n\015()] * # normal*
  2095. (?: # (
  2096. (?: \\ [^\x80-\xff] |
  2097. \( # (
  2098. [^\\\x80-\xff\n\015()] * # normal*
  2099. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  2100. \) # )
  2101. ) # special
  2102. [^\\\x80-\xff\n\015()] * # normal*
  2103. )* # )*
  2104. \) # )
  2105. [\040\t]* )* # If comment found, allow more spaces.
  2106. # optional trailing comments
  2107. (?:
  2108. \.
  2109. [\040\t]* # Nab whitespace.
  2110. (?:
  2111. \( # (
  2112. [^\\\x80-\xff\n\015()] * # normal*
  2113. (?: # (
  2114. (?: \\ [^\x80-\xff] |
  2115. \( # (
  2116. [^\\\x80-\xff\n\015()] * # normal*
  2117. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  2118. \) # )
  2119. ) # special
  2120. [^\\\x80-\xff\n\015()] * # normal*
  2121. )* # )*
  2122. \) # )
  2123. [\040\t]* )* # If comment found, allow more spaces.
  2124. (?:
  2125. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  2126. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  2127. |
  2128. \[ # [
  2129. (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
  2130. \] # ]
  2131. )
  2132. [\040\t]* # Nab whitespace.
  2133. (?:
  2134. \( # (
  2135. [^\\\x80-\xff\n\015()] * # normal*
  2136. (?: # (
  2137. (?: \\ [^\x80-\xff] |
  2138. \( # (
  2139. [^\\\x80-\xff\n\015()] * # normal*
  2140. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  2141. \) # )
  2142. ) # special
  2143. [^\\\x80-\xff\n\015()] * # normal*
  2144. )* # )*
  2145. \) # )
  2146. [\040\t]* )* # If comment found, allow more spaces.
  2147. # optional trailing comments
  2148. )*
  2149. )* # additional domains
  2150. :
  2151. [\040\t]* # Nab whitespace.
  2152. (?:
  2153. \( # (
  2154. [^\\\x80-\xff\n\015()] * # normal*
  2155. (?: # (
  2156. (?: \\ [^\x80-\xff] |
  2157. \( # (
  2158. [^\\\x80-\xff\n\015()] * # normal*
  2159. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  2160. \) # )
  2161. ) # special
  2162. [^\\\x80-\xff\n\015()] * # normal*
  2163. )* # )*
  2164. \) # )
  2165. [\040\t]* )* # If comment found, allow more spaces.
  2166. # optional trailing comments
  2167. )? # optional route
  2168. (?:
  2169. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  2170. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  2171. # Atom
  2172. | # or
  2173. " # "
  2174. [^\\\x80-\xff\n\015"] * # normal
  2175. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )*
  2176. " # "
  2177. # Quoted string
  2178. )
  2179. [\040\t]* # Nab whitespace.
  2180. (?:
  2181. \( # (
  2182. [^\\\x80-\xff\n\015()] * # normal*
  2183. (?: # (
  2184. (?: \\ [^\x80-\xff] |
  2185. \( # (
  2186. [^\\\x80-\xff\n\015()] * # normal*
  2187. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  2188. \) # )
  2189. ) # special
  2190. [^\\\x80-\xff\n\015()] * # normal*
  2191. )* # )*
  2192. \) # )
  2193. [\040\t]* )* # If comment found, allow more spaces.
  2194. (?:
  2195. \.
  2196. [\040\t]* # Nab whitespace.
  2197. (?:
  2198. \( # (
  2199. [^\\\x80-\xff\n\015()] * # normal*
  2200. (?: # (
  2201. (?: \\ [^\x80-\xff] |
  2202. \( # (
  2203. [^\\\x80-\xff\n\015()] * # normal*
  2204. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  2205. \) # )
  2206. ) # special
  2207. [^\\\x80-\xff\n\015()] * # normal*
  2208. )* # )*
  2209. \) # )
  2210. [\040\t]* )* # If comment found, allow more spaces.
  2211. (?:
  2212. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  2213. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  2214. # Atom
  2215. | # or
  2216. " # "
  2217. [^\\\x80-\xff\n\015"] * # normal
  2218. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )*
  2219. " # "
  2220. # Quoted string
  2221. )
  2222. [\040\t]* # Nab whitespace.
  2223. (?:
  2224. \( # (
  2225. [^\\\x80-\xff\n\015()] * # normal*
  2226. (?: # (
  2227. (?: \\ [^\x80-\xff] |
  2228. \( # (
  2229. [^\\\x80-\xff\n\015()] * # normal*
  2230. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  2231. \) # )
  2232. ) # special
  2233. [^\\\x80-\xff\n\015()] * # normal*
  2234. )* # )*
  2235. \) # )
  2236. [\040\t]* )* # If comment found, allow more spaces.
  2237. # additional words
  2238. )*
  2239. @
  2240. [\040\t]* # Nab whitespace.
  2241. (?:
  2242. \( # (
  2243. [^\\\x80-\xff\n\015()] * # normal*
  2244. (?: # (
  2245. (?: \\ [^\x80-\xff] |
  2246. \( # (
  2247. [^\\\x80-\xff\n\015()] * # normal*
  2248. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  2249. \) # )
  2250. ) # special
  2251. [^\\\x80-\xff\n\015()] * # normal*
  2252. )* # )*
  2253. \) # )
  2254. [\040\t]* )* # If comment found, allow more spaces.
  2255. (?:
  2256. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  2257. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  2258. |
  2259. \[ # [
  2260. (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
  2261. \] # ]
  2262. )
  2263. [\040\t]* # Nab whitespace.
  2264. (?:
  2265. \( # (
  2266. [^\\\x80-\xff\n\015()] * # normal*
  2267. (?: # (
  2268. (?: \\ [^\x80-\xff] |
  2269. \( # (
  2270. [^\\\x80-\xff\n\015()] * # normal*
  2271. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  2272. \) # )
  2273. ) # special
  2274. [^\\\x80-\xff\n\015()] * # normal*
  2275. )* # )*
  2276. \) # )
  2277. [\040\t]* )* # If comment found, allow more spaces.
  2278. # optional trailing comments
  2279. (?:
  2280. \.
  2281. [\040\t]* # Nab whitespace.
  2282. (?:
  2283. \( # (
  2284. [^\\\x80-\xff\n\015()] * # normal*
  2285. (?: # (
  2286. (?: \\ [^\x80-\xff] |
  2287. \( # (
  2288. [^\\\x80-\xff\n\015()] * # normal*
  2289. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  2290. \) # )
  2291. ) # special
  2292. [^\\\x80-\xff\n\015()] * # normal*
  2293. )* # )*
  2294. \) # )
  2295. [\040\t]* )* # If comment found, allow more spaces.
  2296. (?:
  2297. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  2298. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  2299. |
  2300. \[ # [
  2301. (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
  2302. \] # ]
  2303. )
  2304. [\040\t]* # Nab whitespace.
  2305. (?:
  2306. \( # (
  2307. [^\\\x80-\xff\n\015()] * # normal*
  2308. (?: # (
  2309. (?: \\ [^\x80-\xff] |
  2310. \( # (
  2311. [^\\\x80-\xff\n\015()] * # normal*
  2312. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  2313. \) # )
  2314. ) # special
  2315. [^\\\x80-\xff\n\015()] * # normal*
  2316. )* # )*
  2317. \) # )
  2318. [\040\t]* )* # If comment found, allow more spaces.
  2319. # optional trailing comments
  2320. )*
  2321. # address spec
  2322. > # >
  2323. # name and address
  2324. )
  2325. /x
  2326. Alan Other <user\@dom.ain>
  2327. 0: Alan Other <[email protected]>
  2328. <user\@dom.ain>
  2329. 0: [email protected]
  2330. 1: user@dom
  2331. user\@dom.ain
  2332. 0: [email protected]
  2333. 1: user@dom
  2334. \"A. Other\" <user.1234\@dom.ain> (a comment)
  2335. 0: "A. Other" <[email protected]>
  2336. A. Other <user.1234\@dom.ain> (a comment)
  2337. 0: Other <[email protected]>
  2338. \"/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/\"\@x400-re.lay
  2339. 0: "/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/"@x400-re.lay
  2340. 1: "/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/"@x400-re
  2341. A missing angle <user\@some.where
  2342. 0: [email protected]
  2343. 1: user@some
  2344. \= Expect no match
  2345. The quick brown fox
  2346. No match
  2347. /abc\0def\00pqr\000xyz\0000AB/
  2348. abc\0def\00pqr\000xyz\0000AB
  2349. 0: abc\x00def\x00pqr\x00xyz\x000AB
  2350. abc456 abc\0def\00pqr\000xyz\0000ABCDE
  2351. 0: abc\x00def\x00pqr\x00xyz\x000AB
  2352. /abc\x0def\x00pqr\x000xyz\x0000AB/
  2353. abc\x0def\x00pqr\x000xyz\x0000AB
  2354. 0: abc\x0def\x00pqr\x000xyz\x0000AB
  2355. abc456 abc\x0def\x00pqr\x000xyz\x0000ABCDE
  2356. 0: abc\x0def\x00pqr\x000xyz\x0000AB
  2357. /^[\000-\037]/
  2358. \0A
  2359. 0: \x00
  2360. \01B
  2361. 0: \x01
  2362. \037C
  2363. 0: \x1f
  2364. /\0*/
  2365. \0\0\0\0
  2366. 0: \x00\x00\x00\x00
  2367. /A\x0{2,3}Z/
  2368. The A\x0\x0Z
  2369. 0: A\x00\x00Z
  2370. An A\0\x0\0Z
  2371. 0: A\x00\x00\x00Z
  2372. \= Expect no match
  2373. A\0Z
  2374. No match
  2375. A\0\x0\0\x0Z
  2376. No match
  2377. /^\s/
  2378. \040abc
  2379. 0:
  2380. \x0cabc
  2381. 0: \x0c
  2382. \nabc
  2383. 0: \x0a
  2384. \rabc
  2385. 0: \x0d
  2386. \tabc
  2387. 0: \x09
  2388. \= Expect no match
  2389. abc
  2390. No match
  2391. /^a b
  2392. c/x
  2393. abc
  2394. 0: abc
  2395. /ab{1,3}bc/
  2396. abbbbc
  2397. 0: abbbbc
  2398. abbbc
  2399. 0: abbbc
  2400. abbc
  2401. 0: abbc
  2402. \= Expect no match
  2403. abc
  2404. No match
  2405. abbbbbc
  2406. No match
  2407. /([^.]*)\.([^:]*):[T ]+(.*)/
  2408. track1.title:TBlah blah blah
  2409. 0: track1.title:TBlah blah blah
  2410. /([^.]*)\.([^:]*):[T ]+(.*)/i
  2411. track1.title:TBlah blah blah
  2412. 0: track1.title:TBlah blah blah
  2413. /([^.]*)\.([^:]*):[t ]+(.*)/i
  2414. track1.title:TBlah blah blah
  2415. 0: track1.title:TBlah blah blah
  2416. /^[W-c]+$/
  2417. WXY_^abc
  2418. 0: WXY_^abc
  2419. \= Expect no match
  2420. wxy
  2421. No match
  2422. /^[W-c]+$/i
  2423. WXY_^abc
  2424. 0: WXY_^abc
  2425. wxy_^ABC
  2426. 0: wxy_^ABC
  2427. /^[\x3f-\x5F]+$/i
  2428. WXY_^abc
  2429. 0: WXY_^abc
  2430. wxy_^ABC
  2431. 0: wxy_^ABC
  2432. /^abc$/m
  2433. abc
  2434. 0: abc
  2435. qqq\nabc
  2436. 0: abc
  2437. abc\nzzz
  2438. 0: abc
  2439. qqq\nabc\nzzz
  2440. 0: abc
  2441. /^abc$/
  2442. abc
  2443. 0: abc
  2444. \= Expect no match
  2445. qqq\nabc
  2446. No match
  2447. abc\nzzz
  2448. No match
  2449. qqq\nabc\nzzz
  2450. No match
  2451. /\Aabc\Z/m
  2452. abc
  2453. 0: abc
  2454. abc\n
  2455. 0: abc
  2456. \= Expect no match
  2457. qqq\nabc
  2458. No match
  2459. abc\nzzz
  2460. No match
  2461. qqq\nabc\nzzz
  2462. No match
  2463. /\A(.)*\Z/s
  2464. abc\ndef
  2465. 0: abc\x0adef
  2466. /\A(.)*\Z/m
  2467. \= Expect no match
  2468. abc\ndef
  2469. No match
  2470. /(?:b)|(?::+)/
  2471. b::c
  2472. 0: b
  2473. c::b
  2474. 0: ::
  2475. /[-az]+/
  2476. az-
  2477. 0: az-
  2478. \= Expect no match
  2479. b
  2480. No match
  2481. /[az-]+/
  2482. za-
  2483. 0: za-
  2484. \= Expect no match
  2485. b
  2486. No match
  2487. /[a\-z]+/
  2488. a-z
  2489. 0: a-z
  2490. \= Expect no match
  2491. b
  2492. No match
  2493. /[a-z]+/
  2494. abcdxyz
  2495. 0: abcdxyz
  2496. /[\d-]+/
  2497. 12-34
  2498. 0: 12-34
  2499. \= Expect no match
  2500. aaa
  2501. No match
  2502. /\x5c/
  2503. \\
  2504. 0: \
  2505. /\x20Z/
  2506. the Zoo
  2507. 0: Z
  2508. \= Expect no match
  2509. Zulu
  2510. No match
  2511. /ab{3cd/
  2512. ab{3cd
  2513. 0: ab{3cd
  2514. /ab{3,cd/
  2515. ab{3,cd
  2516. 0: ab{3,cd
  2517. /ab{3,4a}cd/
  2518. ab{3,4a}cd
  2519. 0: ab{3,4a}cd
  2520. /{4,5a}bc/
  2521. {4,5a}bc
  2522. 0: {4,5a}bc
  2523. /^a.b/newline=lf
  2524. a\rb
  2525. 0: a\x0db
  2526. \= Expect no match
  2527. a\nb
  2528. No match
  2529. /abc$/
  2530. abc
  2531. 0: abc
  2532. abc\n
  2533. 0: abc
  2534. \= Expect no match
  2535. abc\ndef
  2536. No match
  2537. /(abc)\123/
  2538. abc\x53
  2539. 0: abcS
  2540. /(abc)\223/
  2541. abc\x93
  2542. 0: abc\x93
  2543. /(abc)\323/
  2544. abc\xd3
  2545. 0: abc\xd3
  2546. /(abc)\100/
  2547. abc\x40
  2548. 0: abc@
  2549. abc\100
  2550. 0: abc@
  2551. /(abc)\1000/
  2552. abc\x400
  2553. 0: abc@0
  2554. abc\x40\x30
  2555. 0: abc@0
  2556. abc\1000
  2557. 0: abc@0
  2558. abc\100\x30
  2559. 0: abc@0
  2560. abc\100\060
  2561. 0: abc@0
  2562. abc\100\60
  2563. 0: abc@0
  2564. /(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)\12\123/
  2565. abcdefghijk\12S
  2566. 0: abcdefghijk\x0aS
  2567. /a{0}bc/
  2568. bc
  2569. 0: bc
  2570. /(a|(bc)){0,0}?xyz/
  2571. xyz
  2572. 0: xyz
  2573. /abc[\10]de/
  2574. abc\010de
  2575. 0: abc\x08de
  2576. /abc[\1]de/
  2577. abc\1de
  2578. 0: abc\x01de
  2579. /(abc)[\1]de/
  2580. abc\1de
  2581. 0: abc\x01de
  2582. /(?s)a.b/
  2583. a\nb
  2584. 0: a\x0ab
  2585. /^([^a])([^\b])([^c]*)([^d]{3,4})/
  2586. baNOTccccd
  2587. 0: baNOTcccc
  2588. 1: baNOTccc
  2589. 2: baNOTcc
  2590. 3: baNOTc
  2591. baNOTcccd
  2592. 0: baNOTccc
  2593. 1: baNOTcc
  2594. 2: baNOTc
  2595. baNOTccd
  2596. 0: baNOTcc
  2597. 1: baNOTc
  2598. bacccd
  2599. 0: baccc
  2600. \= Expect no match
  2601. anything
  2602. No match
  2603. b\bc
  2604. No match
  2605. baccd
  2606. No match
  2607. /[^a]/
  2608. Abc
  2609. 0: A
  2610. /[^a]/i
  2611. Abc
  2612. 0: b
  2613. /[^a]+/
  2614. AAAaAbc
  2615. 0: AAA
  2616. /[^a]+/i
  2617. AAAaAbc
  2618. 0: bc
  2619. /[^a]+/
  2620. bbb\nccc
  2621. 0: bbb\x0accc
  2622. /[^k]$/
  2623. abc
  2624. 0: c
  2625. \= Expect no match
  2626. abk
  2627. No match
  2628. /[^k]{2,3}$/
  2629. abc
  2630. 0: abc
  2631. kbc
  2632. 0: bc
  2633. kabc
  2634. 0: abc
  2635. \= Expect no match
  2636. abk
  2637. No match
  2638. akb
  2639. No match
  2640. akk
  2641. No match
  2642. /^\d{8,}\@.+[^k]$/
  2643. 12345678\@a.b.c.d
  2644. 0: [email protected]
  2645. 123456789\@x.y.z
  2646. 0: [email protected]
  2647. \= Expect no match
  2648. 12345678\@x.y.uk
  2649. No match
  2650. 1234567\@a.b.c.d
  2651. No match
  2652. /[^a]/
  2653. aaaabcd
  2654. 0: b
  2655. aaAabcd
  2656. 0: A
  2657. /[^a]/i
  2658. aaaabcd
  2659. 0: b
  2660. aaAabcd
  2661. 0: b
  2662. /[^az]/
  2663. aaaabcd
  2664. 0: b
  2665. aaAabcd
  2666. 0: A
  2667. /[^az]/i
  2668. aaaabcd
  2669. 0: b
  2670. aaAabcd
  2671. 0: b
  2672. /\000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037\040\041\042\043\044\045\046\047\050\051\052\053\054\055\056\057\060\061\062\063\064\065\066\067\070\071\072\073\074\075\076\077\100\101\102\103\104\105\106\107\110\111\112\113\114\115\116\117\120\121\122\123\124\125\126\127\130\131\132\133\134\135\136\137\140\141\142\143\144\145\146\147\150\151\152\153\154\155\156\157\160\161\162\163\164\165\166\167\170\171\172\173\174\175\176\177\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377/
  2673. \000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037\040\041\042\043\044\045\046\047\050\051\052\053\054\055\056\057\060\061\062\063\064\065\066\067\070\071\072\073\074\075\076\077\100\101\102\103\104\105\106\107\110\111\112\113\114\115\116\117\120\121\122\123\124\125\126\127\130\131\132\133\134\135\136\137\140\141\142\143\144\145\146\147\150\151\152\153\154\155\156\157\160\161\162\163\164\165\166\167\170\171\172\173\174\175\176\177\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377
  2674. 0: \x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff
  2675. /P[^*]TAIRE[^*]{1,6}?LL/
  2676. xxxxxxxxxxxPSTAIREISLLxxxxxxxxx
  2677. 0: PSTAIREISLL
  2678. /P[^*]TAIRE[^*]{1,}?LL/
  2679. xxxxxxxxxxxPSTAIREISLLxxxxxxxxx
  2680. 0: PSTAIREISLL
  2681. /(\.\d\d[1-9]?)\d+/
  2682. 1.230003938
  2683. 0: .230003938
  2684. 1.875000282
  2685. 0: .875000282
  2686. 1.235
  2687. 0: .235
  2688. /(\.\d\d((?=0)|\d(?=\d)))/
  2689. 1.230003938
  2690. 0: .230
  2691. 1: .23
  2692. 1.875000282
  2693. 0: .875
  2694. \= Expect no match
  2695. 1.235
  2696. No match
  2697. /a(?)b/
  2698. ab
  2699. 0: ab
  2700. /\b(foo)\s+(\w+)/i
  2701. Food is on the foo table
  2702. 0: foo table
  2703. /foo(.*)bar/
  2704. The food is under the bar in the barn.
  2705. 0: food is under the bar in the bar
  2706. 1: food is under the bar
  2707. /foo(.*?)bar/
  2708. The food is under the bar in the barn.
  2709. 0: food is under the bar in the bar
  2710. 1: food is under the bar
  2711. /(.*)(\d*)/no_auto_possess
  2712. I have 2 numbers: 53147
  2713. Matched, but offsets vector is too small to show all matches
  2714. 0: I have 2 numbers: 53147
  2715. 1: I have 2 numbers: 5314
  2716. 2: I have 2 numbers: 531
  2717. 3: I have 2 numbers: 53
  2718. 4: I have 2 numbers: 5
  2719. 5: I have 2 numbers:
  2720. 6: I have 2 numbers:
  2721. 7: I have 2 numbers
  2722. 8: I have 2 number
  2723. 9: I have 2 numbe
  2724. 10: I have 2 numb
  2725. 11: I have 2 num
  2726. 12: I have 2 nu
  2727. 13: I have 2 n
  2728. 14: I have 2
  2729. /(.*)(\d+)/
  2730. I have 2 numbers: 53147
  2731. 0: I have 2 numbers: 53147
  2732. 1: I have 2
  2733. /(.*?)(\d*)/no_auto_possess
  2734. I have 2 numbers: 53147
  2735. Matched, but offsets vector is too small to show all matches
  2736. 0: I have 2 numbers: 53147
  2737. 1: I have 2 numbers: 5314
  2738. 2: I have 2 numbers: 531
  2739. 3: I have 2 numbers: 53
  2740. 4: I have 2 numbers: 5
  2741. 5: I have 2 numbers:
  2742. 6: I have 2 numbers:
  2743. 7: I have 2 numbers
  2744. 8: I have 2 number
  2745. 9: I have 2 numbe
  2746. 10: I have 2 numb
  2747. 11: I have 2 num
  2748. 12: I have 2 nu
  2749. 13: I have 2 n
  2750. 14: I have 2
  2751. /(.*?)(\d+)/
  2752. I have 2 numbers: 53147
  2753. 0: I have 2 numbers: 53147
  2754. 1: I have 2
  2755. /(.*)(\d+)$/
  2756. I have 2 numbers: 53147
  2757. 0: I have 2 numbers: 53147
  2758. /(.*?)(\d+)$/
  2759. I have 2 numbers: 53147
  2760. 0: I have 2 numbers: 53147
  2761. /(.*)\b(\d+)$/
  2762. I have 2 numbers: 53147
  2763. 0: I have 2 numbers: 53147
  2764. /(.*\D)(\d+)$/
  2765. I have 2 numbers: 53147
  2766. 0: I have 2 numbers: 53147
  2767. /^\D*(?!123)/
  2768. ABC123
  2769. 0: AB
  2770. 1: A
  2771. 2:
  2772. /^(\D*)(?=\d)(?!123)/
  2773. ABC445
  2774. 0: ABC
  2775. \= Expect no match
  2776. ABC123
  2777. No match
  2778. /^[W-]46]/
  2779. W46]789
  2780. 0: W46]
  2781. -46]789
  2782. 0: -46]
  2783. \= Expect no match
  2784. Wall
  2785. No match
  2786. Zebra
  2787. No match
  2788. 42
  2789. No match
  2790. [abcd]
  2791. No match
  2792. ]abcd[
  2793. No match
  2794. /^[W-\]46]/
  2795. W46]789
  2796. 0: W
  2797. Wall
  2798. 0: W
  2799. Zebra
  2800. 0: Z
  2801. Xylophone
  2802. 0: X
  2803. 42
  2804. 0: 4
  2805. [abcd]
  2806. 0: [
  2807. ]abcd[
  2808. 0: ]
  2809. \\backslash
  2810. 0: \
  2811. \= Expect no match
  2812. -46]789
  2813. No match
  2814. well
  2815. No match
  2816. /\d\d\/\d\d\/\d\d\d\d/
  2817. 01/01/2000
  2818. 0: 01/01/2000
  2819. /word (?:[a-zA-Z0-9]+ ){0,10}otherword/
  2820. word cat dog elephant mussel cow horse canary baboon snake shark otherword
  2821. 0: word cat dog elephant mussel cow horse canary baboon snake shark otherword
  2822. \= Expect no match
  2823. word cat dog elephant mussel cow horse canary baboon snake shark
  2824. No match
  2825. /word (?:[a-zA-Z0-9]+ ){0,300}otherword/
  2826. \= Expect no match
  2827. word cat dog elephant mussel cow horse canary baboon snake shark the quick brown fox and the lazy dog and several other words getting close to thirty by now I hope
  2828. No match
  2829. /^(a){0,0}/
  2830. bcd
  2831. 0:
  2832. abc
  2833. 0:
  2834. aab
  2835. 0:
  2836. /^(a){0,1}/
  2837. bcd
  2838. 0:
  2839. abc
  2840. 0: a
  2841. 1:
  2842. aab
  2843. 0: a
  2844. 1:
  2845. /^(a){0,2}/
  2846. bcd
  2847. 0:
  2848. abc
  2849. 0: a
  2850. 1:
  2851. aab
  2852. 0: aa
  2853. 1: a
  2854. 2:
  2855. /^(a){0,3}/
  2856. bcd
  2857. 0:
  2858. abc
  2859. 0: a
  2860. 1:
  2861. aab
  2862. 0: aa
  2863. 1: a
  2864. 2:
  2865. aaa
  2866. 0: aaa
  2867. 1: aa
  2868. 2: a
  2869. 3:
  2870. /^(a){0,}/
  2871. bcd
  2872. 0:
  2873. abc
  2874. 0: a
  2875. 1:
  2876. aab
  2877. 0: aa
  2878. 1: a
  2879. 2:
  2880. aaa
  2881. 0: aaa
  2882. 1: aa
  2883. 2: a
  2884. 3:
  2885. aaaaaaaa
  2886. 0: aaaaaaaa
  2887. 1: aaaaaaa
  2888. 2: aaaaaa
  2889. 3: aaaaa
  2890. 4: aaaa
  2891. 5: aaa
  2892. 6: aa
  2893. 7: a
  2894. 8:
  2895. /^(a){1,1}/
  2896. abc
  2897. 0: a
  2898. aab
  2899. 0: a
  2900. \= Expect no match
  2901. bcd
  2902. No match
  2903. /^(a){1,2}/
  2904. abc
  2905. 0: a
  2906. aab
  2907. 0: aa
  2908. 1: a
  2909. \= Expect no match
  2910. bcd
  2911. No match
  2912. /^(a){1,3}/
  2913. abc
  2914. 0: a
  2915. aab
  2916. 0: aa
  2917. 1: a
  2918. aaa
  2919. 0: aaa
  2920. 1: aa
  2921. 2: a
  2922. \= Expect no match
  2923. bcd
  2924. No match
  2925. /^(a){1,}/
  2926. abc
  2927. 0: a
  2928. aab
  2929. 0: aa
  2930. 1: a
  2931. aaa
  2932. 0: aaa
  2933. 1: aa
  2934. 2: a
  2935. aaaaaaaa
  2936. 0: aaaaaaaa
  2937. 1: aaaaaaa
  2938. 2: aaaaaa
  2939. 3: aaaaa
  2940. 4: aaaa
  2941. 5: aaa
  2942. 6: aa
  2943. 7: a
  2944. \= Expect no match
  2945. bcd
  2946. No match
  2947. /.*\.gif/
  2948. borfle\nbib.gif\nno
  2949. 0: bib.gif
  2950. /.{0,}\.gif/
  2951. borfle\nbib.gif\nno
  2952. 0: bib.gif
  2953. /.*\.gif/m
  2954. borfle\nbib.gif\nno
  2955. 0: bib.gif
  2956. /.*\.gif/s
  2957. borfle\nbib.gif\nno
  2958. 0: borfle\x0abib.gif
  2959. /.*\.gif/ms
  2960. borfle\nbib.gif\nno
  2961. 0: borfle\x0abib.gif
  2962. /.*$/
  2963. borfle\nbib.gif\nno
  2964. 0: no
  2965. /.*$/m
  2966. borfle\nbib.gif\nno
  2967. 0: borfle
  2968. /.*$/s
  2969. borfle\nbib.gif\nno
  2970. 0: borfle\x0abib.gif\x0ano
  2971. /.*$/ms
  2972. borfle\nbib.gif\nno
  2973. 0: borfle\x0abib.gif\x0ano
  2974. 1: borfle\x0abib.gif
  2975. 2: borfle
  2976. /.*$/
  2977. borfle\nbib.gif\nno\n
  2978. 0: no
  2979. /.*$/m
  2980. borfle\nbib.gif\nno\n
  2981. 0: borfle
  2982. /.*$/s
  2983. borfle\nbib.gif\nno\n
  2984. 0: borfle\x0abib.gif\x0ano\x0a
  2985. 1: borfle\x0abib.gif\x0ano
  2986. /.*$/ms
  2987. borfle\nbib.gif\nno\n
  2988. 0: borfle\x0abib.gif\x0ano\x0a
  2989. 1: borfle\x0abib.gif\x0ano
  2990. 2: borfle\x0abib.gif
  2991. 3: borfle
  2992. /(.*X|^B)/
  2993. abcde\n1234Xyz
  2994. 0: 1234X
  2995. BarFoo
  2996. 0: B
  2997. \= Expect no match
  2998. abcde\nBar
  2999. No match
  3000. /(.*X|^B)/m
  3001. abcde\n1234Xyz
  3002. 0: 1234X
  3003. BarFoo
  3004. 0: B
  3005. abcde\nBar
  3006. 0: B
  3007. /(.*X|^B)/s
  3008. abcde\n1234Xyz
  3009. 0: abcde\x0a1234X
  3010. BarFoo
  3011. 0: B
  3012. \= Expect no match
  3013. abcde\nBar
  3014. No match
  3015. /(.*X|^B)/ms
  3016. abcde\n1234Xyz
  3017. 0: abcde\x0a1234X
  3018. BarFoo
  3019. 0: B
  3020. abcde\nBar
  3021. 0: B
  3022. /(?s)(.*X|^B)/
  3023. abcde\n1234Xyz
  3024. 0: abcde\x0a1234X
  3025. BarFoo
  3026. 0: B
  3027. \= Expect no match
  3028. abcde\nBar
  3029. No match
  3030. /(?s:.*X|^B)/
  3031. abcde\n1234Xyz
  3032. 0: abcde\x0a1234X
  3033. BarFoo
  3034. 0: B
  3035. \= Expect no match
  3036. abcde\nBar
  3037. No match
  3038. /^.*B/
  3039. \= Expect no match
  3040. abc\nB
  3041. No match
  3042. /(?s)^.*B/
  3043. abc\nB
  3044. 0: abc\x0aB
  3045. /(?m)^.*B/
  3046. abc\nB
  3047. 0: B
  3048. /(?ms)^.*B/
  3049. abc\nB
  3050. 0: abc\x0aB
  3051. /(?ms)^B/
  3052. abc\nB
  3053. 0: B
  3054. /(?s)B$/
  3055. B\n
  3056. 0: B
  3057. /^[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]/
  3058. 123456654321
  3059. 0: 123456654321
  3060. /^\d\d\d\d\d\d\d\d\d\d\d\d/
  3061. 123456654321
  3062. 0: 123456654321
  3063. /^[\d][\d][\d][\d][\d][\d][\d][\d][\d][\d][\d][\d]/
  3064. 123456654321
  3065. 0: 123456654321
  3066. /^[abc]{12}/
  3067. abcabcabcabc
  3068. 0: abcabcabcabc
  3069. /^[a-c]{12}/
  3070. abcabcabcabc
  3071. 0: abcabcabcabc
  3072. /^(a|b|c){12}/
  3073. abcabcabcabc
  3074. 0: abcabcabcabc
  3075. /^[abcdefghijklmnopqrstuvwxy0123456789]/
  3076. n
  3077. 0: n
  3078. \= Expect no match
  3079. z
  3080. No match
  3081. /abcde{0,0}/
  3082. abcd
  3083. 0: abcd
  3084. \= Expect no match
  3085. abce
  3086. No match
  3087. /ab[cd]{0,0}e/
  3088. abe
  3089. 0: abe
  3090. \= Expect no match
  3091. abcde
  3092. No match
  3093. /ab(c){0,0}d/
  3094. abd
  3095. 0: abd
  3096. \= Expect no match
  3097. abcd
  3098. No match
  3099. /a(b*)/
  3100. a
  3101. 0: a
  3102. ab
  3103. 0: ab
  3104. abbbb
  3105. 0: abbbb
  3106. \= Expect no match
  3107. bbbbb
  3108. No match
  3109. /ab\d{0}e/
  3110. abe
  3111. 0: abe
  3112. \= Expect no match
  3113. ab1e
  3114. No match
  3115. /"([^\\"]+|\\.)*"/
  3116. the \"quick\" brown fox
  3117. 0: "quick"
  3118. \"the \\\"quick\\\" brown fox\"
  3119. 0: "the \"quick\" brown fox"
  3120. /.*?/g,aftertext
  3121. abc
  3122. 0: abc
  3123. 0+
  3124. 1: ab
  3125. 2: a
  3126. 3:
  3127. 0:
  3128. 0+
  3129. /\b/g,aftertext
  3130. abc
  3131. 0:
  3132. 0+ abc
  3133. 0:
  3134. 0+
  3135. /\b/g,aftertext
  3136. abc
  3137. 0:
  3138. 0+ abc
  3139. 0:
  3140. 0+
  3141. //g
  3142. abc
  3143. 0:
  3144. 0:
  3145. 0:
  3146. 0:
  3147. /<tr([\w\W\s\d][^<>]{0,})><TD([\w\W\s\d][^<>]{0,})>([\d]{0,}\.)(.*)((<BR>([\w\W\s\d][^<>]{0,})|[\s]{0,}))<\/a><\/TD><TD([\w\W\s\d][^<>]{0,})>([\w\W\s\d][^<>]{0,})<\/TD><TD([\w\W\s\d][^<>]{0,})>([\w\W\s\d][^<>]{0,})<\/TD><\/TR>/is
  3148. <TR BGCOLOR='#DBE9E9'><TD align=left valign=top>43.<a href='joblist.cfm?JobID=94 6735&Keyword='>Word Processor<BR>(N-1286)</a></TD><TD align=left valign=top>Lega lstaff.com</TD><TD align=left valign=top>CA - Statewide</TD></TR>
  3149. 0: <TR BGCOLOR='#DBE9E9'><TD align=left valign=top>43.<a href='joblist.cfm?JobID=94 6735&Keyword='>Word Processor<BR>(N-1286)</a></TD><TD align=left valign=top>Lega lstaff.com</TD><TD align=left valign=top>CA - Statewide</TD></TR>
  3150. /a[^a]b/
  3151. acb
  3152. 0: acb
  3153. a\nb
  3154. 0: a\x0ab
  3155. /a.b/
  3156. acb
  3157. 0: acb
  3158. \= Expect no match
  3159. a\nb
  3160. No match
  3161. /a[^a]b/s
  3162. acb
  3163. 0: acb
  3164. a\nb
  3165. 0: a\x0ab
  3166. /a.b/s
  3167. acb
  3168. 0: acb
  3169. a\nb
  3170. 0: a\x0ab
  3171. /^(b+?|a){1,2}?c/
  3172. bac
  3173. 0: bac
  3174. bbac
  3175. 0: bbac
  3176. bbbac
  3177. 0: bbbac
  3178. bbbbac
  3179. 0: bbbbac
  3180. bbbbbac
  3181. 0: bbbbbac
  3182. /^(b+|a){1,2}?c/
  3183. bac
  3184. 0: bac
  3185. bbac
  3186. 0: bbac
  3187. bbbac
  3188. 0: bbbac
  3189. bbbbac
  3190. 0: bbbbac
  3191. bbbbbac
  3192. 0: bbbbbac
  3193. /(?!\A)x/m
  3194. a\bx\n
  3195. 0: x
  3196. \= Expect no match
  3197. x\nb\n
  3198. No match
  3199. /\x0{ab}/
  3200. \0{ab}
  3201. 0: \x00{ab}
  3202. /(A|B)*?CD/
  3203. CD
  3204. 0: CD
  3205. /(A|B)*CD/
  3206. CD
  3207. 0: CD
  3208. /(?<!bar)foo/
  3209. foo
  3210. 0: foo
  3211. catfood
  3212. 0: foo
  3213. arfootle
  3214. 0: foo
  3215. rfoosh
  3216. 0: foo
  3217. \= Expect no match
  3218. barfoo
  3219. No match
  3220. towbarfoo
  3221. No match
  3222. /\w{3}(?<!bar)foo/
  3223. catfood
  3224. 0: catfoo
  3225. \= Expect no match
  3226. foo
  3227. No match
  3228. barfoo
  3229. No match
  3230. towbarfoo
  3231. No match
  3232. /(?<=(foo)a)bar/
  3233. fooabar
  3234. 0: bar
  3235. \= Expect no match
  3236. bar
  3237. No match
  3238. foobbar
  3239. No match
  3240. /\Aabc\z/m
  3241. abc
  3242. 0: abc
  3243. \= Expect no match
  3244. abc\n
  3245. No match
  3246. qqq\nabc
  3247. No match
  3248. abc\nzzz
  3249. No match
  3250. qqq\nabc\nzzz
  3251. No match
  3252. "(?>.*/)foo"
  3253. \= Expect no match
  3254. /this/is/a/very/long/line/in/deed/with/very/many/slashes/in/it/you/see/
  3255. No match
  3256. "(?>.*/)foo"
  3257. /this/is/a/very/long/line/in/deed/with/very/many/slashes/in/and/foo
  3258. 0: /this/is/a/very/long/line/in/deed/with/very/many/slashes/in/and/foo
  3259. /(?>(\.\d\d[1-9]?))\d+/
  3260. 1.230003938
  3261. 0: .230003938
  3262. 1.875000282
  3263. 0: .875000282
  3264. \= Expect no match
  3265. 1.235
  3266. No match
  3267. /^((?>\w+)|(?>\s+))*$/
  3268. now is the time for all good men to come to the aid of the party
  3269. 0: now is the time for all good men to come to the aid of the party
  3270. \= Expect no match
  3271. this is not a line with only words and spaces!
  3272. No match
  3273. /(\d+)(\w)/
  3274. 12345a
  3275. 0: 12345a
  3276. 1: 12345
  3277. 2: 1234
  3278. 3: 123
  3279. 4: 12
  3280. 12345+
  3281. 0: 12345
  3282. 1: 1234
  3283. 2: 123
  3284. 3: 12
  3285. /((?>\d+))(\w)/
  3286. 12345a
  3287. 0: 12345a
  3288. \= Expect no match
  3289. 12345+
  3290. No match
  3291. /(?>a+)b/
  3292. aaab
  3293. 0: aaab
  3294. /((?>a+)b)/
  3295. aaab
  3296. 0: aaab
  3297. /(?>(a+))b/
  3298. aaab
  3299. 0: aaab
  3300. /(?>b)+/
  3301. aaabbbccc
  3302. 0: bbb
  3303. 1: bb
  3304. 2: b
  3305. /(?>a+|b+|c+)*c/
  3306. aaabbbbccccd
  3307. 0: aaabbbbcccc
  3308. 1: aaabbbbc
  3309. /(a+|b+|c+)*c/
  3310. aaabbbbccccd
  3311. 0: aaabbbbcccc
  3312. 1: aaabbbbccc
  3313. 2: aaabbbbcc
  3314. 3: aaabbbbc
  3315. /((?>[^()]+)|\([^()]*\))+/
  3316. ((abc(ade)ufh()()x
  3317. 0: abc(ade)ufh()()x
  3318. 1: abc(ade)ufh()()
  3319. 2: abc(ade)ufh()
  3320. 3: abc(ade)ufh
  3321. 4: abc(ade)
  3322. 5: abc
  3323. /\(((?>[^()]+)|\([^()]+\))+\)/
  3324. (abc)
  3325. 0: (abc)
  3326. (abc(def)xyz)
  3327. 0: (abc(def)xyz)
  3328. \= Expect no match
  3329. ((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
  3330. No match
  3331. /a(?-i)b/i
  3332. ab
  3333. 0: ab
  3334. Ab
  3335. 0: Ab
  3336. \= Expect no match
  3337. aB
  3338. No match
  3339. AB
  3340. No match
  3341. /(a (?x)b c)d e/
  3342. a bcd e
  3343. 0: a bcd e
  3344. \= Expect no match
  3345. a b cd e
  3346. No match
  3347. abcd e
  3348. No match
  3349. a bcde
  3350. No match
  3351. /(a b(?x)c d (?-x)e f)/
  3352. a bcde f
  3353. 0: a bcde f
  3354. \= Expect no match
  3355. abcdef
  3356. No match
  3357. /(a(?i)b)c/
  3358. abc
  3359. 0: abc
  3360. aBc
  3361. 0: aBc
  3362. \= Expect no match
  3363. abC
  3364. No match
  3365. aBC
  3366. No match
  3367. Abc
  3368. No match
  3369. ABc
  3370. No match
  3371. ABC
  3372. No match
  3373. AbC
  3374. No match
  3375. /a(?i:b)c/
  3376. abc
  3377. 0: abc
  3378. aBc
  3379. 0: aBc
  3380. \= Expect no match
  3381. ABC
  3382. No match
  3383. abC
  3384. No match
  3385. aBC
  3386. No match
  3387. /a(?i:b)*c/
  3388. aBc
  3389. 0: aBc
  3390. aBBc
  3391. 0: aBBc
  3392. \= Expect no match
  3393. aBC
  3394. No match
  3395. aBBC
  3396. No match
  3397. /a(?=b(?i)c)\w\wd/
  3398. abcd
  3399. 0: abcd
  3400. abCd
  3401. 0: abCd
  3402. \= Expect no match
  3403. aBCd
  3404. No match
  3405. abcD
  3406. No match
  3407. /(?s-i:more.*than).*million/i
  3408. more than million
  3409. 0: more than million
  3410. more than MILLION
  3411. 0: more than MILLION
  3412. more \n than Million
  3413. 0: more \x0a than Million
  3414. \= Expect no match
  3415. MORE THAN MILLION
  3416. No match
  3417. more \n than \n million
  3418. No match
  3419. /(?:(?s-i)more.*than).*million/i
  3420. more than million
  3421. 0: more than million
  3422. more than MILLION
  3423. 0: more than MILLION
  3424. more \n than Million
  3425. 0: more \x0a than Million
  3426. \= Expect no match
  3427. MORE THAN MILLION
  3428. No match
  3429. more \n than \n million
  3430. No match
  3431. /(?>a(?i)b+)+c/
  3432. abc
  3433. 0: abc
  3434. aBbc
  3435. 0: aBbc
  3436. aBBc
  3437. 0: aBBc
  3438. \= Expect no match
  3439. Abc
  3440. No match
  3441. abAb
  3442. No match
  3443. abbC
  3444. No match
  3445. /(?=a(?i)b)\w\wc/
  3446. abc
  3447. 0: abc
  3448. aBc
  3449. 0: aBc
  3450. \= Expect no match
  3451. Ab
  3452. No match
  3453. abC
  3454. No match
  3455. aBC
  3456. No match
  3457. /(?<=a(?i)b)(\w\w)c/
  3458. abxxc
  3459. 0: xxc
  3460. aBxxc
  3461. 0: xxc
  3462. \= Expect no match
  3463. Abxxc
  3464. No match
  3465. ABxxc
  3466. No match
  3467. abxxC
  3468. No match
  3469. /^(?(?=abc)\w{3}:|\d\d)$/
  3470. abc:
  3471. 0: abc:
  3472. 12
  3473. 0: 12
  3474. \= Expect no match
  3475. 123
  3476. No match
  3477. xyz
  3478. No match
  3479. /^(?(?!abc)\d\d|\w{3}:)$/
  3480. abc:
  3481. 0: abc:
  3482. 12
  3483. 0: 12
  3484. \= Expect no match
  3485. 123
  3486. No match
  3487. xyz
  3488. No match
  3489. /(?(?<=foo)bar|cat)/
  3490. foobar
  3491. 0: bar
  3492. cat
  3493. 0: cat
  3494. fcat
  3495. 0: cat
  3496. focat
  3497. 0: cat
  3498. \= Expect no match
  3499. foocat
  3500. No match
  3501. /(?(?<!foo)cat|bar)/
  3502. foobar
  3503. 0: bar
  3504. cat
  3505. 0: cat
  3506. fcat
  3507. 0: cat
  3508. focat
  3509. 0: cat
  3510. \= Expect no match
  3511. foocat
  3512. No match
  3513. /(?>a*)*/
  3514. a
  3515. 0: a
  3516. 1:
  3517. aa
  3518. 0: aa
  3519. 1:
  3520. aaaa
  3521. 0: aaaa
  3522. 1:
  3523. /(abc|)+/
  3524. abc
  3525. 0: abc
  3526. 1:
  3527. abcabc
  3528. 0: abcabc
  3529. 1: abc
  3530. 2:
  3531. abcabcabc
  3532. 0: abcabcabc
  3533. 1: abcabc
  3534. 2: abc
  3535. 3:
  3536. xyz
  3537. 0:
  3538. /([a]*)*/
  3539. a
  3540. 0: a
  3541. 1:
  3542. aaaaa
  3543. 0: aaaaa
  3544. 1: aaaa
  3545. 2: aaa
  3546. 3: aa
  3547. 4: a
  3548. 5:
  3549. /([ab]*)*/
  3550. a
  3551. 0: a
  3552. 1:
  3553. b
  3554. 0: b
  3555. 1:
  3556. ababab
  3557. 0: ababab
  3558. 1: ababa
  3559. 2: abab
  3560. 3: aba
  3561. 4: ab
  3562. 5: a
  3563. 6:
  3564. aaaabcde
  3565. 0: aaaab
  3566. 1: aaaa
  3567. 2: aaa
  3568. 3: aa
  3569. 4: a
  3570. 5:
  3571. bbbb
  3572. 0: bbbb
  3573. 1: bbb
  3574. 2: bb
  3575. 3: b
  3576. 4:
  3577. /([^a]*)*/
  3578. b
  3579. 0: b
  3580. 1:
  3581. bbbb
  3582. 0: bbbb
  3583. 1: bbb
  3584. 2: bb
  3585. 3: b
  3586. 4:
  3587. aaa
  3588. 0:
  3589. /([^ab]*)*/
  3590. cccc
  3591. 0: cccc
  3592. 1: ccc
  3593. 2: cc
  3594. 3: c
  3595. 4:
  3596. abab
  3597. 0:
  3598. /([a]*?)*/
  3599. a
  3600. 0: a
  3601. 1:
  3602. aaaa
  3603. 0: aaaa
  3604. 1: aaa
  3605. 2: aa
  3606. 3: a
  3607. 4:
  3608. /([ab]*?)*/
  3609. a
  3610. 0: a
  3611. 1:
  3612. b
  3613. 0: b
  3614. 1:
  3615. abab
  3616. 0: abab
  3617. 1: aba
  3618. 2: ab
  3619. 3: a
  3620. 4:
  3621. baba
  3622. 0: baba
  3623. 1: bab
  3624. 2: ba
  3625. 3: b
  3626. 4:
  3627. /([^a]*?)*/
  3628. b
  3629. 0: b
  3630. 1:
  3631. bbbb
  3632. 0: bbbb
  3633. 1: bbb
  3634. 2: bb
  3635. 3: b
  3636. 4:
  3637. aaa
  3638. 0:
  3639. /([^ab]*?)*/
  3640. c
  3641. 0: c
  3642. 1:
  3643. cccc
  3644. 0: cccc
  3645. 1: ccc
  3646. 2: cc
  3647. 3: c
  3648. 4:
  3649. baba
  3650. 0:
  3651. /(?>a*)*/
  3652. a
  3653. 0: a
  3654. 1:
  3655. aaabcde
  3656. 0: aaa
  3657. 1:
  3658. /((?>a*))*/
  3659. aaaaa
  3660. 0: aaaaa
  3661. 1:
  3662. aabbaa
  3663. 0: aa
  3664. 1:
  3665. /((?>a*?))*/
  3666. aaaaa
  3667. 0: aaaaa
  3668. 1:
  3669. aabbaa
  3670. 0: aa
  3671. 1:
  3672. /(?(?=[^a-z]+[a-z]) \d{2}-[a-z]{3}-\d{2} | \d{2}-\d{2}-\d{2} ) /x
  3673. 12-sep-98
  3674. 0: 12-sep-98
  3675. 12-09-98
  3676. 0: 12-09-98
  3677. \= Expect no match
  3678. sep-12-98
  3679. No match
  3680. /(?i:saturday|sunday)/
  3681. saturday
  3682. 0: saturday
  3683. sunday
  3684. 0: sunday
  3685. Saturday
  3686. 0: Saturday
  3687. Sunday
  3688. 0: Sunday
  3689. SATURDAY
  3690. 0: SATURDAY
  3691. SUNDAY
  3692. 0: SUNDAY
  3693. SunDay
  3694. 0: SunDay
  3695. /(a(?i)bc|BB)x/
  3696. abcx
  3697. 0: abcx
  3698. aBCx
  3699. 0: aBCx
  3700. bbx
  3701. 0: bbx
  3702. BBx
  3703. 0: BBx
  3704. \= Expect no match
  3705. abcX
  3706. No match
  3707. aBCX
  3708. No match
  3709. bbX
  3710. No match
  3711. BBX
  3712. No match
  3713. /^([ab](?i)[cd]|[ef])/
  3714. ac
  3715. 0: ac
  3716. aC
  3717. 0: aC
  3718. bD
  3719. 0: bD
  3720. elephant
  3721. 0: e
  3722. Europe
  3723. 0: E
  3724. frog
  3725. 0: f
  3726. France
  3727. 0: F
  3728. \= Expect no match
  3729. Africa
  3730. No match
  3731. /^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)/
  3732. ab
  3733. 0: ab
  3734. aBd
  3735. 0: aBd
  3736. xy
  3737. 0: xy
  3738. xY
  3739. 0: xY
  3740. zebra
  3741. 0: z
  3742. Zambesi
  3743. 0: Z
  3744. \= Expect no match
  3745. aCD
  3746. No match
  3747. XY
  3748. No match
  3749. /(?<=foo\n)^bar/m
  3750. foo\nbar
  3751. 0: bar
  3752. \= Expect no match
  3753. bar
  3754. No match
  3755. baz\nbar
  3756. No match
  3757. /(?<=(?<!foo)bar)baz/
  3758. barbaz
  3759. 0: baz
  3760. barbarbaz
  3761. 0: baz
  3762. koobarbaz
  3763. 0: baz
  3764. \= Expect no match
  3765. baz
  3766. No match
  3767. foobarbaz
  3768. No match
  3769. # The following tests are taken from the Perl 5.005 test suite; some of them
  3770. # are compatible with 5.004, but I'd rather not have to sort them out.
  3771. /abc/
  3772. abc
  3773. 0: abc
  3774. xabcy
  3775. 0: abc
  3776. ababc
  3777. 0: abc
  3778. \= Expect no match
  3779. xbc
  3780. No match
  3781. axc
  3782. No match
  3783. abx
  3784. No match
  3785. /ab*c/
  3786. abc
  3787. 0: abc
  3788. /ab*bc/
  3789. abc
  3790. 0: abc
  3791. abbc
  3792. 0: abbc
  3793. abbbbc
  3794. 0: abbbbc
  3795. /.{1}/
  3796. abbbbc
  3797. 0: a
  3798. /.{3,4}/
  3799. abbbbc
  3800. 0: abbb
  3801. /ab{0,}bc/
  3802. abbbbc
  3803. 0: abbbbc
  3804. /ab+bc/
  3805. abbc
  3806. 0: abbc
  3807. \= Expect no match
  3808. abc
  3809. No match
  3810. abq
  3811. No match
  3812. /ab+bc/
  3813. abbbbc
  3814. 0: abbbbc
  3815. /ab{1,}bc/
  3816. abbbbc
  3817. 0: abbbbc
  3818. /ab{1,3}bc/
  3819. abbbbc
  3820. 0: abbbbc
  3821. /ab{3,4}bc/
  3822. abbbbc
  3823. 0: abbbbc
  3824. /ab{4,5}bc/
  3825. \= Expect no match
  3826. abq
  3827. No match
  3828. abbbbc
  3829. No match
  3830. /ab?bc/
  3831. abbc
  3832. 0: abbc
  3833. abc
  3834. 0: abc
  3835. /ab{0,1}bc/
  3836. abc
  3837. 0: abc
  3838. /ab?bc/
  3839. /ab?c/
  3840. abc
  3841. 0: abc
  3842. /ab{0,1}c/
  3843. abc
  3844. 0: abc
  3845. /^abc$/
  3846. abc
  3847. 0: abc
  3848. \= Expect no match
  3849. abbbbc
  3850. No match
  3851. abcc
  3852. No match
  3853. /^abc/
  3854. abcc
  3855. 0: abc
  3856. /^abc$/
  3857. /abc$/
  3858. aabc
  3859. 0: abc
  3860. aabc
  3861. 0: abc
  3862. \= Expect no match
  3863. aabcd
  3864. No match
  3865. /^/
  3866. abc
  3867. 0:
  3868. /$/
  3869. abc
  3870. 0:
  3871. /a.c/
  3872. abc
  3873. 0: abc
  3874. axc
  3875. 0: axc
  3876. /a.*c/
  3877. axyzc
  3878. 0: axyzc
  3879. /a[bc]d/
  3880. abd
  3881. 0: abd
  3882. \= Expect no match
  3883. axyzd
  3884. No match
  3885. abc
  3886. No match
  3887. /a[b-d]e/
  3888. ace
  3889. 0: ace
  3890. /a[b-d]/
  3891. aac
  3892. 0: ac
  3893. /a[-b]/
  3894. a-
  3895. 0: a-
  3896. /a[b-]/
  3897. a-
  3898. 0: a-
  3899. /a]/
  3900. a]
  3901. 0: a]
  3902. /a[]]b/
  3903. a]b
  3904. 0: a]b
  3905. /a[^bc]d/
  3906. aed
  3907. 0: aed
  3908. \= Expect no match
  3909. abd
  3910. No match
  3911. abd
  3912. No match
  3913. /a[^-b]c/
  3914. adc
  3915. 0: adc
  3916. /a[^]b]c/
  3917. adc
  3918. 0: adc
  3919. a-c
  3920. 0: a-c
  3921. \= Expect no match
  3922. a]c
  3923. No match
  3924. /\ba\b/
  3925. a-
  3926. 0: a
  3927. -a
  3928. 0: a
  3929. -a-
  3930. 0: a
  3931. /\by\b/
  3932. \= Expect no match
  3933. xy
  3934. No match
  3935. yz
  3936. No match
  3937. xyz
  3938. No match
  3939. /\Ba\B/
  3940. \= Expect no match
  3941. a-
  3942. No match
  3943. -a
  3944. No match
  3945. -a-
  3946. No match
  3947. /\By\b/
  3948. xy
  3949. 0: y
  3950. /\by\B/
  3951. yz
  3952. 0: y
  3953. /\By\B/
  3954. xyz
  3955. 0: y
  3956. /\w/
  3957. a
  3958. 0: a
  3959. /\W/
  3960. -
  3961. 0: -
  3962. \= Expect no match
  3963. a
  3964. No match
  3965. /a\sb/
  3966. a b
  3967. 0: a b
  3968. /a\Sb/
  3969. a-b
  3970. 0: a-b
  3971. \= Expect no match
  3972. a b
  3973. No match
  3974. /\d/
  3975. 1
  3976. 0: 1
  3977. /\D/
  3978. -
  3979. 0: -
  3980. \= Expect no match
  3981. 1
  3982. No match
  3983. /[\w]/
  3984. a
  3985. 0: a
  3986. /[\W]/
  3987. -
  3988. 0: -
  3989. \= Expect no match
  3990. a
  3991. No match
  3992. /a[\s]b/
  3993. a b
  3994. 0: a b
  3995. /a[\S]b/
  3996. a-b
  3997. 0: a-b
  3998. \= Expect no match
  3999. a b
  4000. No match
  4001. /[\d]/
  4002. 1
  4003. 0: 1
  4004. /[\D]/
  4005. -
  4006. 0: -
  4007. \= Expect no match
  4008. 1
  4009. No match
  4010. /ab|cd/
  4011. abc
  4012. 0: ab
  4013. abcd
  4014. 0: ab
  4015. /()ef/
  4016. def
  4017. 0: ef
  4018. /$b/
  4019. /a\(b/
  4020. a(b
  4021. 0: a(b
  4022. /a\(*b/
  4023. ab
  4024. 0: ab
  4025. a((b
  4026. 0: a((b
  4027. /a\\b/
  4028. a\\b
  4029. 0: a\b
  4030. \= Expect no match
  4031. a\b
  4032. No match
  4033. /((a))/
  4034. abc
  4035. 0: a
  4036. /(a)b(c)/
  4037. abc
  4038. 0: abc
  4039. /a+b+c/
  4040. aabbabc
  4041. 0: abc
  4042. /a{1,}b{1,}c/
  4043. aabbabc
  4044. 0: abc
  4045. /a.+?c/
  4046. abcabc
  4047. 0: abcabc
  4048. 1: abc
  4049. /(a+|b)*/
  4050. ab
  4051. 0: ab
  4052. 1: a
  4053. 2:
  4054. /(a+|b){0,}/
  4055. ab
  4056. 0: ab
  4057. 1: a
  4058. 2:
  4059. /(a+|b)+/
  4060. ab
  4061. 0: ab
  4062. 1: a
  4063. /(a+|b){1,}/
  4064. ab
  4065. 0: ab
  4066. 1: a
  4067. /(a+|b)?/
  4068. ab
  4069. 0: a
  4070. 1:
  4071. /(a+|b){0,1}/
  4072. ab
  4073. 0: a
  4074. 1:
  4075. /[^ab]*/
  4076. cde
  4077. 0: cde
  4078. /abc/
  4079. \= Expect no match
  4080. b
  4081. No match
  4082. /a*/
  4083. /([abc])*d/
  4084. abbbcd
  4085. 0: abbbcd
  4086. /([abc])*bcd/
  4087. abcd
  4088. 0: abcd
  4089. /a|b|c|d|e/
  4090. e
  4091. 0: e
  4092. /(a|b|c|d|e)f/
  4093. ef
  4094. 0: ef
  4095. /abcd*efg/
  4096. abcdefg
  4097. 0: abcdefg
  4098. /ab*/
  4099. xabyabbbz
  4100. 0: ab
  4101. xayabbbz
  4102. 0: a
  4103. /(ab|cd)e/
  4104. abcde
  4105. 0: cde
  4106. /[abhgefdc]ij/
  4107. hij
  4108. 0: hij
  4109. /^(ab|cd)e/
  4110. /(abc|)ef/
  4111. abcdef
  4112. 0: ef
  4113. /(a|b)c*d/
  4114. abcd
  4115. 0: bcd
  4116. /(ab|ab*)bc/
  4117. abc
  4118. 0: abc
  4119. /a([bc]*)c*/
  4120. abc
  4121. 0: abc
  4122. 1: a
  4123. /a([bc]*)(c*d)/
  4124. abcd
  4125. 0: abcd
  4126. /a([bc]+)(c*d)/
  4127. abcd
  4128. 0: abcd
  4129. /a([bc]*)(c+d)/
  4130. abcd
  4131. 0: abcd
  4132. /a[bcd]*dcdcde/
  4133. adcdcde
  4134. 0: adcdcde
  4135. /a[bcd]+dcdcde/
  4136. \= Expect no match
  4137. abcde
  4138. No match
  4139. adcdcde
  4140. No match
  4141. /(ab|a)b*c/
  4142. abc
  4143. 0: abc
  4144. /((a)(b)c)(d)/
  4145. abcd
  4146. 0: abcd
  4147. /[a-zA-Z_][a-zA-Z0-9_]*/
  4148. alpha
  4149. 0: alpha
  4150. /^a(bc+|b[eh])g|.h$/
  4151. abh
  4152. 0: bh
  4153. /(bc+d$|ef*g.|h?i(j|k))/
  4154. effgz
  4155. 0: effgz
  4156. ij
  4157. 0: ij
  4158. reffgz
  4159. 0: effgz
  4160. \= Expect no match
  4161. effg
  4162. No match
  4163. bcdd
  4164. No match
  4165. /((((((((((a))))))))))/
  4166. a
  4167. 0: a
  4168. /(((((((((a)))))))))/
  4169. a
  4170. 0: a
  4171. /multiple words of text/
  4172. \= Expect no match
  4173. aa
  4174. No match
  4175. uh-uh
  4176. No match
  4177. /multiple words/
  4178. multiple words, yeah
  4179. 0: multiple words
  4180. /(.*)c(.*)/
  4181. abcde
  4182. 0: abcde
  4183. /\((.*), (.*)\)/
  4184. (a, b)
  4185. 0: (a, b)
  4186. /[k]/
  4187. /abcd/
  4188. abcd
  4189. 0: abcd
  4190. /a(bc)d/
  4191. abcd
  4192. 0: abcd
  4193. /a[-]?c/
  4194. ac
  4195. 0: ac
  4196. /abc/i
  4197. ABC
  4198. 0: ABC
  4199. XABCY
  4200. 0: ABC
  4201. ABABC
  4202. 0: ABC
  4203. \= Expect no match
  4204. aaxabxbaxbbx
  4205. No match
  4206. XBC
  4207. No match
  4208. AXC
  4209. No match
  4210. ABX
  4211. No match
  4212. /ab*c/i
  4213. ABC
  4214. 0: ABC
  4215. /ab*bc/i
  4216. ABC
  4217. 0: ABC
  4218. ABBC
  4219. 0: ABBC
  4220. /ab*?bc/i
  4221. ABBBBC
  4222. 0: ABBBBC
  4223. /ab{0,}?bc/i
  4224. ABBBBC
  4225. 0: ABBBBC
  4226. /ab+?bc/i
  4227. ABBC
  4228. 0: ABBC
  4229. /ab+bc/i
  4230. \= Expect no match
  4231. ABC
  4232. No match
  4233. ABQ
  4234. No match
  4235. /ab{1,}bc/i
  4236. /ab+bc/i
  4237. ABBBBC
  4238. 0: ABBBBC
  4239. /ab{1,}?bc/i
  4240. ABBBBC
  4241. 0: ABBBBC
  4242. /ab{1,3}?bc/i
  4243. ABBBBC
  4244. 0: ABBBBC
  4245. /ab{3,4}?bc/i
  4246. ABBBBC
  4247. 0: ABBBBC
  4248. /ab{4,5}?bc/i
  4249. \= Expect no match
  4250. ABQ
  4251. No match
  4252. ABBBBC
  4253. No match
  4254. /ab??bc/i
  4255. ABBC
  4256. 0: ABBC
  4257. ABC
  4258. 0: ABC
  4259. /ab{0,1}?bc/i
  4260. ABC
  4261. 0: ABC
  4262. /ab??bc/i
  4263. /ab??c/i
  4264. ABC
  4265. 0: ABC
  4266. /ab{0,1}?c/i
  4267. ABC
  4268. 0: ABC
  4269. /^abc$/i
  4270. ABC
  4271. 0: ABC
  4272. \= Expect no match
  4273. ABBBBC
  4274. No match
  4275. ABCC
  4276. No match
  4277. /^abc/i
  4278. ABCC
  4279. 0: ABC
  4280. /^abc$/i
  4281. /abc$/i
  4282. AABC
  4283. 0: ABC
  4284. /^/i
  4285. ABC
  4286. 0:
  4287. /$/i
  4288. ABC
  4289. 0:
  4290. /a.c/i
  4291. ABC
  4292. 0: ABC
  4293. AXC
  4294. 0: AXC
  4295. /a.*?c/i
  4296. AXYZC
  4297. 0: AXYZC
  4298. /a.*c/i
  4299. AABC
  4300. 0: AABC
  4301. \= Expect no match
  4302. AXYZD
  4303. No match
  4304. /a[bc]d/i
  4305. ABD
  4306. 0: ABD
  4307. /a[b-d]e/i
  4308. ACE
  4309. 0: ACE
  4310. \= Expect no match
  4311. ABC
  4312. No match
  4313. ABD
  4314. No match
  4315. /a[b-d]/i
  4316. AAC
  4317. 0: AC
  4318. /a[-b]/i
  4319. A-
  4320. 0: A-
  4321. /a[b-]/i
  4322. A-
  4323. 0: A-
  4324. /a]/i
  4325. A]
  4326. 0: A]
  4327. /a[]]b/i
  4328. A]B
  4329. 0: A]B
  4330. /a[^bc]d/i
  4331. AED
  4332. 0: AED
  4333. /a[^-b]c/i
  4334. ADC
  4335. 0: ADC
  4336. \= Expect no match
  4337. ABD
  4338. No match
  4339. A-C
  4340. No match
  4341. /a[^]b]c/i
  4342. ADC
  4343. 0: ADC
  4344. /ab|cd/i
  4345. ABC
  4346. 0: AB
  4347. ABCD
  4348. 0: AB
  4349. /()ef/i
  4350. DEF
  4351. 0: EF
  4352. /$b/i
  4353. \= Expect no match
  4354. A]C
  4355. No match
  4356. B
  4357. No match
  4358. /a\(b/i
  4359. A(B
  4360. 0: A(B
  4361. /a\(*b/i
  4362. AB
  4363. 0: AB
  4364. A((B
  4365. 0: A((B
  4366. /a\\b/i
  4367. \= Expect no match
  4368. A\=notbol
  4369. No match
  4370. /((a))/i
  4371. ABC
  4372. 0: A
  4373. /(a)b(c)/i
  4374. ABC
  4375. 0: ABC
  4376. /a+b+c/i
  4377. AABBABC
  4378. 0: ABC
  4379. /a{1,}b{1,}c/i
  4380. AABBABC
  4381. 0: ABC
  4382. /a.+?c/i
  4383. ABCABC
  4384. 0: ABCABC
  4385. 1: ABC
  4386. /a.*?c/i
  4387. ABCABC
  4388. 0: ABCABC
  4389. 1: ABC
  4390. /a.{0,5}?c/i
  4391. ABCABC
  4392. 0: ABCABC
  4393. 1: ABC
  4394. /(a+|b)*/i
  4395. AB
  4396. 0: AB
  4397. 1: A
  4398. 2:
  4399. /(a+|b){0,}/i
  4400. AB
  4401. 0: AB
  4402. 1: A
  4403. 2:
  4404. /(a+|b)+/i
  4405. AB
  4406. 0: AB
  4407. 1: A
  4408. /(a+|b){1,}/i
  4409. AB
  4410. 0: AB
  4411. 1: A
  4412. /(a+|b)?/i
  4413. AB
  4414. 0: A
  4415. 1:
  4416. /(a+|b){0,1}/i
  4417. AB
  4418. 0: A
  4419. 1:
  4420. /(a+|b){0,1}?/i
  4421. AB
  4422. 0: A
  4423. 1:
  4424. /[^ab]*/i
  4425. CDE
  4426. 0: CDE
  4427. /abc/i
  4428. /a*/i
  4429. /([abc])*d/i
  4430. ABBBCD
  4431. 0: ABBBCD
  4432. /([abc])*bcd/i
  4433. ABCD
  4434. 0: ABCD
  4435. /a|b|c|d|e/i
  4436. E
  4437. 0: E
  4438. /(a|b|c|d|e)f/i
  4439. EF
  4440. 0: EF
  4441. /abcd*efg/i
  4442. ABCDEFG
  4443. 0: ABCDEFG
  4444. /ab*/i
  4445. XABYABBBZ
  4446. 0: AB
  4447. XAYABBBZ
  4448. 0: A
  4449. /(ab|cd)e/i
  4450. ABCDE
  4451. 0: CDE
  4452. /[abhgefdc]ij/i
  4453. HIJ
  4454. 0: HIJ
  4455. /^(ab|cd)e/i
  4456. \= Expect no match
  4457. ABCDE
  4458. No match
  4459. /(abc|)ef/i
  4460. ABCDEF
  4461. 0: EF
  4462. /(a|b)c*d/i
  4463. ABCD
  4464. 0: BCD
  4465. /(ab|ab*)bc/i
  4466. ABC
  4467. 0: ABC
  4468. /a([bc]*)c*/i
  4469. ABC
  4470. 0: ABC
  4471. 1: A
  4472. /a([bc]*)(c*d)/i
  4473. ABCD
  4474. 0: ABCD
  4475. /a([bc]+)(c*d)/i
  4476. ABCD
  4477. 0: ABCD
  4478. /a([bc]*)(c+d)/i
  4479. ABCD
  4480. 0: ABCD
  4481. /a[bcd]*dcdcde/i
  4482. ADCDCDE
  4483. 0: ADCDCDE
  4484. /a[bcd]+dcdcde/i
  4485. /(ab|a)b*c/i
  4486. ABC
  4487. 0: ABC
  4488. /((a)(b)c)(d)/i
  4489. ABCD
  4490. 0: ABCD
  4491. /[a-zA-Z_][a-zA-Z0-9_]*/i
  4492. ALPHA
  4493. 0: ALPHA
  4494. /^a(bc+|b[eh])g|.h$/i
  4495. ABH
  4496. 0: BH
  4497. /(bc+d$|ef*g.|h?i(j|k))/i
  4498. EFFGZ
  4499. 0: EFFGZ
  4500. IJ
  4501. 0: IJ
  4502. REFFGZ
  4503. 0: EFFGZ
  4504. \= Expect no match
  4505. ADCDCDE
  4506. No match
  4507. EFFG
  4508. No match
  4509. BCDD
  4510. No match
  4511. /((((((((((a))))))))))/i
  4512. A
  4513. 0: A
  4514. /(((((((((a)))))))))/i
  4515. A
  4516. 0: A
  4517. /(?:(?:(?:(?:(?:(?:(?:(?:(?:(a))))))))))/i
  4518. A
  4519. 0: A
  4520. /(?:(?:(?:(?:(?:(?:(?:(?:(?:(a|b|c))))))))))/i
  4521. C
  4522. 0: C
  4523. /multiple words of text/i
  4524. \= Expect no match
  4525. AA
  4526. No match
  4527. UH-UH
  4528. No match
  4529. /multiple words/i
  4530. MULTIPLE WORDS, YEAH
  4531. 0: MULTIPLE WORDS
  4532. /(.*)c(.*)/i
  4533. ABCDE
  4534. 0: ABCDE
  4535. /\((.*), (.*)\)/i
  4536. (A, B)
  4537. 0: (A, B)
  4538. /[k]/i
  4539. /abcd/i
  4540. ABCD
  4541. 0: ABCD
  4542. /a(bc)d/i
  4543. ABCD
  4544. 0: ABCD
  4545. /a[-]?c/i
  4546. AC
  4547. 0: AC
  4548. /a(?!b)./
  4549. abad
  4550. 0: ad
  4551. /a(?=d)./
  4552. abad
  4553. 0: ad
  4554. /a(?=c|d)./
  4555. abad
  4556. 0: ad
  4557. /a(?:b|c|d)(.)/
  4558. ace
  4559. 0: ace
  4560. /a(?:b|c|d)*(.)/
  4561. ace
  4562. 0: ace
  4563. 1: ac
  4564. /a(?:b|c|d)+?(.)/
  4565. ace
  4566. 0: ace
  4567. acdbcdbe
  4568. 0: acdbcdbe
  4569. 1: acdbcdb
  4570. 2: acdbcd
  4571. 3: acdbc
  4572. 4: acdb
  4573. 5: acd
  4574. /a(?:b|c|d)+(.)/
  4575. acdbcdbe
  4576. 0: acdbcdbe
  4577. 1: acdbcdb
  4578. 2: acdbcd
  4579. 3: acdbc
  4580. 4: acdb
  4581. 5: acd
  4582. /a(?:b|c|d){2}(.)/
  4583. acdbcdbe
  4584. 0: acdb
  4585. /a(?:b|c|d){4,5}(.)/
  4586. acdbcdbe
  4587. 0: acdbcdb
  4588. 1: acdbcd
  4589. /a(?:b|c|d){4,5}?(.)/
  4590. acdbcdbe
  4591. 0: acdbcdb
  4592. 1: acdbcd
  4593. /((foo)|(bar))*/
  4594. foobar
  4595. 0: foobar
  4596. 1: foo
  4597. 2:
  4598. /a(?:b|c|d){6,7}(.)/
  4599. acdbcdbe
  4600. 0: acdbcdbe
  4601. /a(?:b|c|d){6,7}?(.)/
  4602. acdbcdbe
  4603. 0: acdbcdbe
  4604. /a(?:b|c|d){5,6}(.)/
  4605. acdbcdbe
  4606. 0: acdbcdbe
  4607. 1: acdbcdb
  4608. /a(?:b|c|d){5,6}?(.)/
  4609. acdbcdbe
  4610. 0: acdbcdbe
  4611. 1: acdbcdb
  4612. /a(?:b|c|d){5,7}(.)/
  4613. acdbcdbe
  4614. 0: acdbcdbe
  4615. 1: acdbcdb
  4616. /a(?:b|c|d){5,7}?(.)/
  4617. acdbcdbe
  4618. 0: acdbcdbe
  4619. 1: acdbcdb
  4620. /a(?:b|(c|e){1,2}?|d)+?(.)/
  4621. ace
  4622. 0: ace
  4623. /^(.+)?B/
  4624. AB
  4625. 0: AB
  4626. /^([^a-z])|(\^)$/
  4627. .
  4628. 0: .
  4629. /^[<>]&/
  4630. <&OUT
  4631. 0: <&
  4632. /(?:(f)(o)(o)|(b)(a)(r))*/
  4633. foobar
  4634. 0: foobar
  4635. 1: foo
  4636. 2:
  4637. /(?<=a)b/
  4638. ab
  4639. 0: b
  4640. \= Expect no match
  4641. cb
  4642. No match
  4643. b
  4644. No match
  4645. /(?<!c)b/
  4646. ab
  4647. 0: b
  4648. b
  4649. 0: b
  4650. b
  4651. 0: b
  4652. /(?:..)*a/
  4653. aba
  4654. 0: aba
  4655. 1: a
  4656. /(?:..)*?a/
  4657. aba
  4658. 0: aba
  4659. 1: a
  4660. /^(){3,5}/
  4661. abc
  4662. 0:
  4663. /^(a+)*ax/
  4664. aax
  4665. 0: aax
  4666. /^((a|b)+)*ax/
  4667. aax
  4668. 0: aax
  4669. /^((a|bc)+)*ax/
  4670. aax
  4671. 0: aax
  4672. /(a|x)*ab/
  4673. cab
  4674. 0: ab
  4675. /(a)*ab/
  4676. cab
  4677. 0: ab
  4678. /(?:(?i)a)b/
  4679. ab
  4680. 0: ab
  4681. /((?i)a)b/
  4682. ab
  4683. 0: ab
  4684. /(?:(?i)a)b/
  4685. Ab
  4686. 0: Ab
  4687. /((?i)a)b/
  4688. Ab
  4689. 0: Ab
  4690. /(?:(?i)a)b/
  4691. \= Expect no match
  4692. cb
  4693. No match
  4694. aB
  4695. No match
  4696. /((?i)a)b/
  4697. /(?i:a)b/
  4698. ab
  4699. 0: ab
  4700. /((?i:a))b/
  4701. ab
  4702. 0: ab
  4703. /(?i:a)b/
  4704. Ab
  4705. 0: Ab
  4706. /((?i:a))b/
  4707. Ab
  4708. 0: Ab
  4709. /(?i:a)b/
  4710. \= Expect no match
  4711. aB
  4712. No match
  4713. aB
  4714. No match
  4715. /((?i:a))b/
  4716. /(?:(?-i)a)b/i
  4717. ab
  4718. 0: ab
  4719. /((?-i)a)b/i
  4720. ab
  4721. 0: ab
  4722. /(?:(?-i)a)b/i
  4723. aB
  4724. 0: aB
  4725. /((?-i)a)b/i
  4726. aB
  4727. 0: aB
  4728. /(?:(?-i)a)b/i
  4729. aB
  4730. 0: aB
  4731. \= Expect no match
  4732. Ab
  4733. No match
  4734. /((?-i)a)b/i
  4735. /(?:(?-i)a)b/i
  4736. aB
  4737. 0: aB
  4738. /((?-i)a)b/i
  4739. aB
  4740. 0: aB
  4741. /(?:(?-i)a)b/i
  4742. \= Expect no match
  4743. Ab
  4744. No match
  4745. AB
  4746. No match
  4747. /((?-i)a)b/i
  4748. /(?-i:a)b/i
  4749. ab
  4750. 0: ab
  4751. /((?-i:a))b/i
  4752. ab
  4753. 0: ab
  4754. /(?-i:a)b/i
  4755. aB
  4756. 0: aB
  4757. /((?-i:a))b/i
  4758. aB
  4759. 0: aB
  4760. /(?-i:a)b/i
  4761. \= Expect no match
  4762. AB
  4763. No match
  4764. Ab
  4765. No match
  4766. /((?-i:a))b/i
  4767. /(?-i:a)b/i
  4768. aB
  4769. 0: aB
  4770. /((?-i:a))b/i
  4771. aB
  4772. 0: aB
  4773. /(?-i:a)b/i
  4774. \= Expect no match
  4775. Ab
  4776. No match
  4777. AB
  4778. No match
  4779. /((?-i:a))b/i
  4780. /((?-i:a.))b/i
  4781. \= Expect no match
  4782. AB
  4783. No match
  4784. a\nB
  4785. No match
  4786. /((?s-i:a.))b/i
  4787. a\nB
  4788. 0: a\x0aB
  4789. /(?:c|d)(?:)(?:a(?:)(?:b)(?:b(?:))(?:b(?:)(?:b)))/
  4790. cabbbb
  4791. 0: cabbbb
  4792. /(?:c|d)(?:)(?:aaaaaaaa(?:)(?:bbbbbbbb)(?:bbbbbbbb(?:))(?:bbbbbbbb(?:)(?:bbbbbbbb)))/
  4793. caaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
  4794. 0: caaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
  4795. /foo\w*\d{4}baz/
  4796. foobar1234baz
  4797. 0: foobar1234baz
  4798. /x(~~)*(?:(?:F)?)?/
  4799. x~~
  4800. 0: x~~
  4801. 1: x
  4802. /^a(?#xxx){3}c/
  4803. aaac
  4804. 0: aaac
  4805. /^a (?#xxx) (?#yyy) {3}c/x
  4806. aaac
  4807. 0: aaac
  4808. /(?<![cd])b/
  4809. \= Expect no match
  4810. B\nB
  4811. No match
  4812. dbcb
  4813. No match
  4814. /(?<![cd])[ab]/
  4815. dbaacb
  4816. 0: a
  4817. /(?<!(c|d))b/
  4818. /(?<!(c|d))[ab]/
  4819. dbaacb
  4820. 0: a
  4821. /(?<!cd)[ab]/
  4822. cdaccb
  4823. 0: b
  4824. /^(?:a?b?)*$/
  4825. \= Expect no match
  4826. dbcb
  4827. No match
  4828. a--
  4829. No match
  4830. /((?s)^a(.))((?m)^b$)/
  4831. a\nb\nc\n
  4832. 0: a\x0ab
  4833. /((?m)^b$)/
  4834. a\nb\nc\n
  4835. 0: b
  4836. /(?m)^b/
  4837. a\nb\n
  4838. 0: b
  4839. /(?m)^(b)/
  4840. a\nb\n
  4841. 0: b
  4842. /((?m)^b)/
  4843. a\nb\n
  4844. 0: b
  4845. /\n((?m)^b)/
  4846. a\nb\n
  4847. 0: \x0ab
  4848. /((?s).)c(?!.)/
  4849. a\nb\nc\n
  4850. 0: \x0ac
  4851. a\nb\nc\n
  4852. 0: \x0ac
  4853. /((?s)b.)c(?!.)/
  4854. a\nb\nc\n
  4855. 0: b\x0ac
  4856. a\nb\nc\n
  4857. 0: b\x0ac
  4858. /^b/
  4859. /()^b/
  4860. \= Expect no match
  4861. a\nb\nc\n
  4862. No match
  4863. a\nb\nc\n
  4864. No match
  4865. /((?m)^b)/
  4866. a\nb\nc\n
  4867. 0: b
  4868. /(?(?!a)a|b)/
  4869. /(?(?!a)b|a)/
  4870. a
  4871. 0: a
  4872. /(?(?=a)b|a)/
  4873. \= Expect no match
  4874. a
  4875. No match
  4876. a
  4877. No match
  4878. /(?(?=a)a|b)/
  4879. a
  4880. 0: a
  4881. /(\w+:)+/
  4882. one:
  4883. 0: one:
  4884. /$(?<=^(a))/
  4885. a
  4886. 0:
  4887. /([\w:]+::)?(\w+)$/
  4888. abcd
  4889. 0: abcd
  4890. xy:z:::abcd
  4891. 0: xy:z:::abcd
  4892. /^[^bcd]*(c+)/
  4893. aexycd
  4894. 0: aexyc
  4895. /(a*)b+/
  4896. caab
  4897. 0: aab
  4898. /([\w:]+::)?(\w+)$/
  4899. abcd
  4900. 0: abcd
  4901. xy:z:::abcd
  4902. 0: xy:z:::abcd
  4903. \= Expect no match
  4904. abcd:
  4905. No match
  4906. abcd:
  4907. No match
  4908. /^[^bcd]*(c+)/
  4909. aexycd
  4910. 0: aexyc
  4911. /(>a+)ab/
  4912. /(?>a+)b/
  4913. aaab
  4914. 0: aaab
  4915. /([[:]+)/
  4916. a:[b]:
  4917. 0: :[
  4918. /([[=]+)/
  4919. a=[b]=
  4920. 0: =[
  4921. /([[.]+)/
  4922. a.[b].
  4923. 0: .[
  4924. /((?>a+)b)/
  4925. aaab
  4926. 0: aaab
  4927. /(?>(a+))b/
  4928. aaab
  4929. 0: aaab
  4930. /((?>[^()]+)|\([^()]*\))+/
  4931. ((abc(ade)ufh()()x
  4932. 0: abc(ade)ufh()()x
  4933. 1: abc(ade)ufh()()
  4934. 2: abc(ade)ufh()
  4935. 3: abc(ade)ufh
  4936. 4: abc(ade)
  4937. 5: abc
  4938. /a\Z/
  4939. \= Expect no match
  4940. aaab
  4941. No match
  4942. a\nb\n
  4943. No match
  4944. /b\Z/
  4945. a\nb\n
  4946. 0: b
  4947. /b\z/
  4948. /b\Z/
  4949. a\nb
  4950. 0: b
  4951. /b\z/
  4952. a\nb
  4953. 0: b
  4954. /(?>.*)(?<=(abcd|wxyz))/
  4955. alphabetabcd
  4956. 0: alphabetabcd
  4957. endingwxyz
  4958. 0: endingwxyz
  4959. \= Expect no match
  4960. a rather long string that doesn't end with one of them
  4961. No match
  4962. /word (?>(?:(?!otherword)[a-zA-Z0-9]+ ){0,30})otherword/
  4963. word cat dog elephant mussel cow horse canary baboon snake shark otherword
  4964. 0: word cat dog elephant mussel cow horse canary baboon snake shark otherword
  4965. \= Expect no match
  4966. word cat dog elephant mussel cow horse canary baboon snake shark
  4967. No match
  4968. /word (?>[a-zA-Z0-9]+ ){0,30}otherword/
  4969. \= Expect no match
  4970. word cat dog elephant mussel cow horse canary baboon snake shark the quick brown fox and the lazy dog and several other words getting close to thirty by now I hope
  4971. No match
  4972. /(?<=\d{3}(?!999))foo/
  4973. 999foo
  4974. 0: foo
  4975. 123999foo
  4976. 0: foo
  4977. \= Expect no match
  4978. 123abcfoo
  4979. No match
  4980. /(?<=(?!...999)\d{3})foo/
  4981. 999foo
  4982. 0: foo
  4983. 123999foo
  4984. 0: foo
  4985. \= Expect no match
  4986. 123abcfoo
  4987. No match
  4988. /(?<=\d{3}(?!999)...)foo/
  4989. 123abcfoo
  4990. 0: foo
  4991. 123456foo
  4992. 0: foo
  4993. \= Expect no match
  4994. 123999foo
  4995. No match
  4996. /(?<=\d{3}...)(?<!999)foo/
  4997. 123abcfoo
  4998. 0: foo
  4999. 123456foo
  5000. 0: foo
  5001. \= Expect no match
  5002. 123999foo
  5003. No match
  5004. /((Z)+|A)*/
  5005. ZABCDEFG
  5006. 0: ZA
  5007. 1: Z
  5008. 2:
  5009. /(Z()|A)*/
  5010. ZABCDEFG
  5011. 0: ZA
  5012. 1: Z
  5013. 2:
  5014. /(Z(())|A)*/
  5015. ZABCDEFG
  5016. 0: ZA
  5017. 1: Z
  5018. 2:
  5019. /((?>Z)+|A)*/
  5020. ZABCDEFG
  5021. 0: ZA
  5022. 1: Z
  5023. 2:
  5024. /((?>)+|A)*/
  5025. ZABCDEFG
  5026. 0:
  5027. /a*/g
  5028. abbab
  5029. 0: a
  5030. 0:
  5031. 0:
  5032. 0: a
  5033. 0:
  5034. 0:
  5035. /[[:space:]]+/
  5036. > \x09\x0a\x0c\x0d\x0b<
  5037. 0: \x09\x0a\x0c\x0d\x0b
  5038. /[[:blank:]]+/
  5039. > \x09\x0a\x0c\x0d\x0b<
  5040. 0: \x09
  5041. /[\s]+/
  5042. > \x09\x0a\x0c\x0d\x0b<
  5043. 0: \x09\x0a\x0c\x0d\x0b
  5044. /\s+/
  5045. > \x09\x0a\x0c\x0d\x0b<
  5046. 0: \x09\x0a\x0c\x0d\x0b
  5047. /a b/x
  5048. ab
  5049. 0: ab
  5050. /(?!\A)x/m
  5051. a\nxb\n
  5052. 0: x
  5053. /(?!^)x/m
  5054. \= Expect no match
  5055. a\nxb\n
  5056. No match
  5057. /abc\Qabc\Eabc/
  5058. abcabcabc
  5059. 0: abcabcabc
  5060. /abc\Q(*+|\Eabc/
  5061. abc(*+|abc
  5062. 0: abc(*+|abc
  5063. / abc\Q abc\Eabc/x
  5064. abc abcabc
  5065. 0: abc abcabc
  5066. \= Expect no match
  5067. abcabcabc
  5068. No match
  5069. /abc#comment
  5070. \Q#not comment
  5071. literal\E/x
  5072. abc#not comment\n literal
  5073. 0: abc#not comment\x0a literal
  5074. /abc#comment
  5075. \Q#not comment
  5076. literal/x
  5077. abc#not comment\n literal
  5078. 0: abc#not comment\x0a literal
  5079. /abc#comment
  5080. \Q#not comment
  5081. literal\E #more comment
  5082. /x
  5083. abc#not comment\n literal
  5084. 0: abc#not comment\x0a literal
  5085. /abc#comment
  5086. \Q#not comment
  5087. literal\E #more comment/x
  5088. abc#not comment\n literal
  5089. 0: abc#not comment\x0a literal
  5090. /\Qabc\$xyz\E/
  5091. abc\\\$xyz
  5092. 0: abc\$xyz
  5093. /\Qabc\E\$\Qxyz\E/
  5094. abc\$xyz
  5095. 0: abc$xyz
  5096. /\Gabc/
  5097. abc
  5098. 0: abc
  5099. \= Expect no match
  5100. xyzabc
  5101. No match
  5102. /\Gabc./g
  5103. abc1abc2xyzabc3
  5104. 0: abc1
  5105. 0: abc2
  5106. /abc./g
  5107. abc1abc2xyzabc3
  5108. 0: abc1
  5109. 0: abc2
  5110. 0: abc3
  5111. /a(?x: b c )d/
  5112. XabcdY
  5113. 0: abcd
  5114. \= Expect no match
  5115. Xa b c d Y
  5116. No match
  5117. /((?x)x y z | a b c)/
  5118. XabcY
  5119. 0: abc
  5120. AxyzB
  5121. 0: xyz
  5122. /(?i)AB(?-i)C/
  5123. XabCY
  5124. 0: abC
  5125. \= Expect no match
  5126. XabcY
  5127. No match
  5128. /((?i)AB(?-i)C|D)E/
  5129. abCE
  5130. 0: abCE
  5131. DE
  5132. 0: DE
  5133. \= Expect no match
  5134. abcE
  5135. No match
  5136. abCe
  5137. No match
  5138. dE
  5139. No match
  5140. De
  5141. No match
  5142. /[z\Qa-d]\E]/
  5143. z
  5144. 0: z
  5145. a
  5146. 0: a
  5147. -
  5148. 0: -
  5149. d
  5150. 0: d
  5151. ]
  5152. 0: ]
  5153. \= Expect no match
  5154. b
  5155. No match
  5156. /(a+)*b/
  5157. \= Expect no match
  5158. aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
  5159. No match
  5160. /(?i)reg(?:ul(?:[aä]|ae)r|ex)/
  5161. REGular
  5162. 0: REGular
  5163. regulaer
  5164. 0: regulaer
  5165. Regex
  5166. 0: Regex
  5167. regulär
  5168. 0: regul\xe4r
  5169. /Åæåä[à-ÿÀ-ß]+/
  5170. Åæåäà
  5171. 0: \xc5\xe6\xe5\xe4\xe0
  5172. Åæåäÿ
  5173. 0: \xc5\xe6\xe5\xe4\xff
  5174. ÅæåäÀ
  5175. 0: \xc5\xe6\xe5\xe4\xc0
  5176. Åæåäß
  5177. 0: \xc5\xe6\xe5\xe4\xdf
  5178. /(?<=Z)X./
  5179. \x84XAZXB
  5180. 0: XB
  5181. /^(?(2)a|(1)(2))+$/
  5182. 123a
  5183. Failed: error -40: backreference condition or recursion test is not supported for DFA matching
  5184. /(?<=a|bbbb)c/
  5185. ac
  5186. 0: c
  5187. bbbbc
  5188. 0: c
  5189. /line\nbreak/
  5190. this is a line\nbreak
  5191. 0: line\x0abreak
  5192. line one\nthis is a line\nbreak in the second line
  5193. 0: line\x0abreak
  5194. /line\nbreak/firstline
  5195. this is a line\nbreak
  5196. 0: line\x0abreak
  5197. \= Expect no match
  5198. line one\nthis is a line\nbreak in the second line
  5199. No match
  5200. /line\nbreak/m,firstline
  5201. this is a line\nbreak
  5202. 0: line\x0abreak
  5203. \= Expect no match
  5204. line one\nthis is a line\nbreak in the second line
  5205. No match
  5206. /1234/
  5207. 123\=ps
  5208. Partial match: 123
  5209. \= Expect no match
  5210. a4\=ps,dfa_restart
  5211. No match
  5212. /1234/
  5213. 123\=ps
  5214. Partial match: 123
  5215. 4\=ps,dfa_restart
  5216. 0: 4
  5217. /^/gm
  5218. a\nb\nc\n
  5219. 0:
  5220. 0:
  5221. 0:
  5222. \
  5223. 0:
  5224. /(?<=C\n)^/gm
  5225. A\nC\nC\n
  5226. 0:
  5227. /(?s)A?B/
  5228. AB
  5229. 0: AB
  5230. aB
  5231. 0: B
  5232. /(?s)A*B/
  5233. AB
  5234. 0: AB
  5235. aB
  5236. 0: B
  5237. /(?m)A?B/
  5238. AB
  5239. 0: AB
  5240. aB
  5241. 0: B
  5242. /(?m)A*B/
  5243. AB
  5244. 0: AB
  5245. aB
  5246. 0: B
  5247. /Content-Type\x3A[^\r\n]{6,}/
  5248. Content-Type:xxxxxyyy
  5249. 0: Content-Type:xxxxxyyy
  5250. /Content-Type\x3A[^\r\n]{6,}z/
  5251. Content-Type:xxxxxyyyz
  5252. 0: Content-Type:xxxxxyyyz
  5253. /Content-Type\x3A[^a]{6,}/
  5254. Content-Type:xxxyyy
  5255. 0: Content-Type:xxxyyy
  5256. /Content-Type\x3A[^a]{6,}z/
  5257. Content-Type:xxxyyyz
  5258. 0: Content-Type:xxxyyyz
  5259. /^abc/Im,newline=lf
  5260. Capture group count = 0
  5261. Options: multiline
  5262. Forced newline is LF
  5263. First code unit at start or follows newline
  5264. Last code unit = 'c'
  5265. Subject length lower bound = 3
  5266. xyz\nabc
  5267. 0: abc
  5268. xyz\r\nabc
  5269. 0: abc
  5270. \= Expect no match
  5271. xyz\rabc
  5272. No match
  5273. xyzabc\r
  5274. No match
  5275. xyzabc\rpqr
  5276. No match
  5277. xyzabc\r\n
  5278. No match
  5279. xyzabc\r\npqr
  5280. No match
  5281. /^abc/Im,newline=crlf
  5282. Capture group count = 0
  5283. Options: multiline
  5284. Forced newline is CRLF
  5285. First code unit at start or follows newline
  5286. Last code unit = 'c'
  5287. Subject length lower bound = 3
  5288. xyz\r\nabclf>
  5289. 0: abc
  5290. \= Expect no match
  5291. xyz\nabclf
  5292. No match
  5293. xyz\rabclf
  5294. No match
  5295. /^abc/Im,newline=cr
  5296. Capture group count = 0
  5297. Options: multiline
  5298. Forced newline is CR
  5299. First code unit at start or follows newline
  5300. Last code unit = 'c'
  5301. Subject length lower bound = 3
  5302. xyz\rabc
  5303. 0: abc
  5304. \= Expect no match
  5305. xyz\nabc
  5306. No match
  5307. xyz\r\nabc
  5308. No match
  5309. /.*/I,newline=lf
  5310. Capture group count = 0
  5311. May match empty string
  5312. Forced newline is LF
  5313. First code unit at start or follows newline
  5314. Subject length lower bound = 0
  5315. abc\ndef
  5316. 0: abc
  5317. abc\rdef
  5318. 0: abc\x0ddef
  5319. abc\r\ndef
  5320. 0: abc\x0d
  5321. /.*/I,newline=cr
  5322. Capture group count = 0
  5323. May match empty string
  5324. Forced newline is CR
  5325. First code unit at start or follows newline
  5326. Subject length lower bound = 0
  5327. abc\ndef
  5328. 0: abc\x0adef
  5329. abc\rdef
  5330. 0: abc
  5331. abc\r\ndef
  5332. 0: abc
  5333. /.*/I,newline=crlf
  5334. Capture group count = 0
  5335. May match empty string
  5336. Forced newline is CRLF
  5337. First code unit at start or follows newline
  5338. Subject length lower bound = 0
  5339. abc\ndef
  5340. 0: abc\x0adef
  5341. abc\rdef
  5342. 0: abc\x0ddef
  5343. abc\r\ndef
  5344. 0: abc
  5345. /\w+(.)(.)?def/Is
  5346. Capture group count = 2
  5347. Options: dotall
  5348. Starting code units: 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P
  5349. Q R S T U V W X Y Z _ a b c d e f g h i j k l m n o p q r s t u v w x y z
  5350. Last code unit = 'f'
  5351. Subject length lower bound = 5
  5352. abc\ndef
  5353. 0: abc\x0adef
  5354. abc\rdef
  5355. 0: abc\x0ddef
  5356. abc\r\ndef
  5357. 0: abc\x0d\x0adef
  5358. /\w+(.)(.)?def/s
  5359. abc\ndef
  5360. 0: abc\x0adef
  5361. abc\rdef
  5362. 0: abc\x0ddef
  5363. abc\r\ndef
  5364. 0: abc\x0d\x0adef
  5365. /^\w+=.*(\\\n.*)*/
  5366. abc=xyz\\\npqr
  5367. 0: abc=xyz\\x0apqr
  5368. 1: abc=xyz\\x0apq
  5369. 2: abc=xyz\\x0ap
  5370. 3: abc=xyz\\x0a
  5371. 4: abc=xyz\
  5372. 5: abc=xyz
  5373. 6: abc=xy
  5374. 7: abc=x
  5375. 8: abc=
  5376. /^(a()*)*/
  5377. aaaa
  5378. 0: aaaa
  5379. 1: aaa
  5380. 2: aa
  5381. 3: a
  5382. 4:
  5383. /^(?:a(?:(?:))*)*/
  5384. aaaa
  5385. 0: aaaa
  5386. 1: aaa
  5387. 2: aa
  5388. 3: a
  5389. 4:
  5390. /^(a()+)+/
  5391. aaaa
  5392. 0: aaaa
  5393. 1: aaa
  5394. 2: aa
  5395. 3: a
  5396. /^(?:a(?:(?:))+)+/
  5397. aaaa
  5398. 0: aaaa
  5399. 1: aaa
  5400. 2: aa
  5401. 3: a
  5402. /(a|)*\d/
  5403. aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4
  5404. 0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4
  5405. \= Expect no match
  5406. aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
  5407. No match
  5408. /(?>a|)*\d/
  5409. aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4
  5410. 0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4
  5411. \= Expect no match
  5412. aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
  5413. No match
  5414. /(?:a|)*\d/
  5415. aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4
  5416. 0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4
  5417. \= Expect no match
  5418. aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
  5419. No match
  5420. /^a.b/newline=lf
  5421. a\rb
  5422. 0: a\x0db
  5423. \= Expect no match
  5424. a\nb
  5425. No match
  5426. /^a.b/newline=cr
  5427. a\nb
  5428. 0: a\x0ab
  5429. \= Expect no match
  5430. a\rb
  5431. No match
  5432. /^a.b/newline=anycrlf
  5433. a\x85b
  5434. 0: a\x85b
  5435. \= Expect no match
  5436. a\rb
  5437. No match
  5438. /^a.b/newline=any
  5439. \= Expect no match
  5440. a\nb
  5441. No match
  5442. a\rb
  5443. No match
  5444. a\x85b
  5445. No match
  5446. /^abc./gmx,newline=any
  5447. abc1 \x0aabc2 \x0babc3xx \x0cabc4 \x0dabc5xx \x0d\x0aabc6 \x85abc7 JUNK
  5448. 0: abc1
  5449. 0: abc2
  5450. 0: abc3
  5451. 0: abc4
  5452. 0: abc5
  5453. 0: abc6
  5454. 0: abc7
  5455. /abc.$/gmx,newline=any
  5456. abc1\x0a abc2\x0b abc3\x0c abc4\x0d abc5\x0d\x0a abc6\x85 abc9
  5457. 0: abc1
  5458. 0: abc2
  5459. 0: abc3
  5460. 0: abc4
  5461. 0: abc5
  5462. 0: abc6
  5463. 0: abc9
  5464. /^a\Rb/bsr=unicode
  5465. a\nb
  5466. 0: a\x0ab
  5467. a\rb
  5468. 0: a\x0db
  5469. a\r\nb
  5470. 0: a\x0d\x0ab
  5471. a\x0bb
  5472. 0: a\x0bb
  5473. a\x0cb
  5474. 0: a\x0cb
  5475. a\x85b
  5476. 0: a\x85b
  5477. \= Expect no match
  5478. a\n\rb
  5479. No match
  5480. /^a\R*b/bsr=unicode
  5481. ab
  5482. 0: ab
  5483. a\nb
  5484. 0: a\x0ab
  5485. a\rb
  5486. 0: a\x0db
  5487. a\r\nb
  5488. 0: a\x0d\x0ab
  5489. a\x0bb
  5490. 0: a\x0bb
  5491. a\x0cb
  5492. 0: a\x0cb
  5493. a\x85b
  5494. 0: a\x85b
  5495. a\n\rb
  5496. 0: a\x0a\x0db
  5497. a\n\r\x85\x0cb
  5498. 0: a\x0a\x0d\x85\x0cb
  5499. /^a\R+b/bsr=unicode
  5500. a\nb
  5501. 0: a\x0ab
  5502. a\rb
  5503. 0: a\x0db
  5504. a\r\nb
  5505. 0: a\x0d\x0ab
  5506. a\x0bb
  5507. 0: a\x0bb
  5508. a\x0cb
  5509. 0: a\x0cb
  5510. a\x85b
  5511. 0: a\x85b
  5512. a\n\rb
  5513. 0: a\x0a\x0db
  5514. a\n\r\x85\x0cb
  5515. 0: a\x0a\x0d\x85\x0cb
  5516. \= Expect no match
  5517. ab
  5518. No match
  5519. /^a\R{1,3}b/bsr=unicode
  5520. a\nb
  5521. 0: a\x0ab
  5522. a\n\rb
  5523. 0: a\x0a\x0db
  5524. a\n\r\x85b
  5525. 0: a\x0a\x0d\x85b
  5526. a\r\n\r\nb
  5527. 0: a\x0d\x0a\x0d\x0ab
  5528. a\r\n\r\n\r\nb
  5529. 0: a\x0d\x0a\x0d\x0a\x0d\x0ab
  5530. a\n\r\n\rb
  5531. 0: a\x0a\x0d\x0a\x0db
  5532. a\n\n\r\nb
  5533. 0: a\x0a\x0a\x0d\x0ab
  5534. \= Expect no match
  5535. a\n\n\n\rb
  5536. No match
  5537. a\r
  5538. No match
  5539. /.+foo/
  5540. afoo
  5541. 0: afoo
  5542. \= Expect no match
  5543. \r\nfoo
  5544. No match
  5545. \nfoo
  5546. No match
  5547. /.+foo/newline=crlf
  5548. afoo
  5549. 0: afoo
  5550. \nfoo
  5551. 0: \x0afoo
  5552. \= Expect no match
  5553. \r\nfoo
  5554. No match
  5555. /.+foo/newline=any
  5556. afoo
  5557. 0: afoo
  5558. \= Expect no match
  5559. \nfoo
  5560. No match
  5561. \r\nfoo
  5562. No match
  5563. /.+foo/s
  5564. afoo
  5565. 0: afoo
  5566. \r\nfoo
  5567. 0: \x0d\x0afoo
  5568. \nfoo
  5569. 0: \x0afoo
  5570. /^$/gm,newline=any
  5571. abc\r\rxyz
  5572. 0:
  5573. abc\n\rxyz
  5574. 0:
  5575. \= Expect no match
  5576. abc\r\nxyz
  5577. No match
  5578. /^X/m
  5579. XABC
  5580. 0: X
  5581. \= Expect no match
  5582. XABC\=notbol
  5583. No match
  5584. /(?m)^$/g,newline=any,aftertext
  5585. abc\r\n\r\n
  5586. 0:
  5587. 0+ \x0d\x0a
  5588. /(?m)^$|^\r\n/g,newline=any,aftertext
  5589. abc\r\n\r\n
  5590. 0: \x0d\x0a
  5591. 0+
  5592. 1:
  5593. /(?m)$/g,newline=any,aftertext
  5594. abc\r\n\r\n
  5595. 0:
  5596. 0+ \x0d\x0a\x0d\x0a
  5597. 0:
  5598. 0+ \x0d\x0a
  5599. 0:
  5600. 0+
  5601. /(?|(abc)|(xyz))/
  5602. >abc<
  5603. 0: abc
  5604. >xyz<
  5605. 0: xyz
  5606. /(x)(?|(abc)|(xyz))(x)/
  5607. xabcx
  5608. 0: xabcx
  5609. xxyzx
  5610. 0: xxyzx
  5611. /(x)(?|(abc)(pqr)|(xyz))(x)/
  5612. xabcpqrx
  5613. 0: xabcpqrx
  5614. xxyzx
  5615. 0: xxyzx
  5616. /(?|(abc)|(xyz))(?1)/
  5617. abcabc
  5618. 0: abcabc
  5619. xyzabc
  5620. 0: xyzabc
  5621. \= Expect no match
  5622. xyzxyz
  5623. No match
  5624. /\H\h\V\v/
  5625. X X\x0a
  5626. 0: X X\x0a
  5627. X\x09X\x0b
  5628. 0: X\x09X\x0b
  5629. \= Expect no match
  5630. \xa0 X\x0a
  5631. No match
  5632. /\H*\h+\V?\v{3,4}/
  5633. \x09\x20\xa0X\x0a\x0b\x0c\x0d\x0a
  5634. 0: \x09 \xa0X\x0a\x0b\x0c\x0d
  5635. \x09\x20\xa0\x0a\x0b\x0c\x0d\x0a
  5636. 0: \x09 \xa0\x0a\x0b\x0c\x0d
  5637. \x09\x20\xa0\x0a\x0b\x0c
  5638. 0: \x09 \xa0\x0a\x0b\x0c
  5639. \= Expect no match
  5640. \x09\x20\xa0\x0a\x0b
  5641. No match
  5642. /\H{3,4}/
  5643. XY ABCDE
  5644. 0: ABCD
  5645. XY PQR ST
  5646. 0: PQR
  5647. /.\h{3,4}./
  5648. XY AB PQRS
  5649. 0: B P
  5650. 1: B
  5651. /\h*X\h?\H+Y\H?Z/
  5652. >XNNNYZ
  5653. 0: XNNNYZ
  5654. > X NYQZ
  5655. 0: X NYQZ
  5656. \= Expect no match
  5657. >XYZ
  5658. No match
  5659. > X NY Z
  5660. No match
  5661. /\v*X\v?Y\v+Z\V*\x0a\V+\x0b\V{2,3}\x0c/
  5662. >XY\x0aZ\x0aA\x0bNN\x0c
  5663. 0: XY\x0aZ\x0aA\x0bNN\x0c
  5664. >\x0a\x0dX\x0aY\x0a\x0bZZZ\x0aAAA\x0bNNN\x0c
  5665. 0: \x0a\x0dX\x0aY\x0a\x0bZZZ\x0aAAA\x0bNNN\x0c
  5666. /.+A/newline=crlf
  5667. \= Expect no match
  5668. \r\nA
  5669. No match
  5670. /\nA/newline=crlf
  5671. \r\nA
  5672. 0: \x0aA
  5673. /[\r\n]A/newline=crlf
  5674. \r\nA
  5675. 0: \x0aA
  5676. /(\r|\n)A/newline=crlf
  5677. \r\nA
  5678. 0: \x0aA
  5679. /a\Rb/I,bsr=anycrlf
  5680. Capture group count = 0
  5681. \R matches CR, LF, or CRLF
  5682. First code unit = 'a'
  5683. Last code unit = 'b'
  5684. Subject length lower bound = 3
  5685. a\rb
  5686. 0: a\x0db
  5687. a\nb
  5688. 0: a\x0ab
  5689. a\r\nb
  5690. 0: a\x0d\x0ab
  5691. \= Expect no match
  5692. a\x85b
  5693. No match
  5694. a\x0bb
  5695. No match
  5696. /a\Rb/I,bsr=unicode
  5697. Capture group count = 0
  5698. \R matches any Unicode newline
  5699. First code unit = 'a'
  5700. Last code unit = 'b'
  5701. Subject length lower bound = 3
  5702. a\rb
  5703. 0: a\x0db
  5704. a\nb
  5705. 0: a\x0ab
  5706. a\r\nb
  5707. 0: a\x0d\x0ab
  5708. a\x85b
  5709. 0: a\x85b
  5710. a\x0bb
  5711. 0: a\x0bb
  5712. /a\R?b/I,bsr=anycrlf
  5713. Capture group count = 0
  5714. \R matches CR, LF, or CRLF
  5715. First code unit = 'a'
  5716. Last code unit = 'b'
  5717. Subject length lower bound = 2
  5718. a\rb
  5719. 0: a\x0db
  5720. a\nb
  5721. 0: a\x0ab
  5722. a\r\nb
  5723. 0: a\x0d\x0ab
  5724. \= Expect no match
  5725. a\x85b
  5726. No match
  5727. a\x0bb
  5728. No match
  5729. /a\R?b/I,bsr=unicode
  5730. Capture group count = 0
  5731. \R matches any Unicode newline
  5732. First code unit = 'a'
  5733. Last code unit = 'b'
  5734. Subject length lower bound = 2
  5735. a\rb
  5736. 0: a\x0db
  5737. a\nb
  5738. 0: a\x0ab
  5739. a\r\nb
  5740. 0: a\x0d\x0ab
  5741. a\x85b
  5742. 0: a\x85b
  5743. a\x0bb
  5744. 0: a\x0bb
  5745. /a\R{2,4}b/I,bsr=anycrlf
  5746. Capture group count = 0
  5747. \R matches CR, LF, or CRLF
  5748. First code unit = 'a'
  5749. Last code unit = 'b'
  5750. Subject length lower bound = 4
  5751. a\r\n\nb
  5752. 0: a\x0d\x0a\x0ab
  5753. a\n\r\rb
  5754. 0: a\x0a\x0d\x0db
  5755. a\r\n\r\n\r\n\r\nb
  5756. 0: a\x0d\x0a\x0d\x0a\x0d\x0a\x0d\x0ab
  5757. \= Expect no match
  5758. a\x0b\x0bb
  5759. No match
  5760. a\x85\x85b
  5761. No match
  5762. /a\R{2,4}b/I,bsr=unicode
  5763. Capture group count = 0
  5764. \R matches any Unicode newline
  5765. First code unit = 'a'
  5766. Last code unit = 'b'
  5767. Subject length lower bound = 4
  5768. a\r\rb
  5769. 0: a\x0d\x0db
  5770. a\n\n\nb
  5771. 0: a\x0a\x0a\x0ab
  5772. a\r\n\n\r\rb
  5773. 0: a\x0d\x0a\x0a\x0d\x0db
  5774. a\x85\x85b
  5775. 0: a\x85\x85b
  5776. a\x0b\x0bb
  5777. 0: a\x0b\x0bb
  5778. \= Expect no match
  5779. a\r\r\r\r\rb
  5780. No match
  5781. /a(?!)|\wbc/
  5782. abc
  5783. 0: abc
  5784. /a[]b/alt_bsux,allow_empty_class,match_unset_backref,dupnames
  5785. \= Expect no match
  5786. ab
  5787. No match
  5788. /a[]+b/alt_bsux,allow_empty_class,match_unset_backref,dupnames
  5789. \= Expect no match
  5790. ab
  5791. No match
  5792. /a[]*+b/alt_bsux,allow_empty_class,match_unset_backref,dupnames
  5793. \= Expect no match
  5794. ab
  5795. No match
  5796. /a[^]b/alt_bsux,allow_empty_class,match_unset_backref,dupnames
  5797. aXb
  5798. 0: aXb
  5799. a\nb
  5800. 0: a\x0ab
  5801. \= Expect no match
  5802. ab
  5803. No match
  5804. /a[^]+b/alt_bsux,allow_empty_class,match_unset_backref,dupnames
  5805. aXb
  5806. 0: aXb
  5807. a\nX\nXb
  5808. 0: a\x0aX\x0aXb
  5809. \= Expect no match
  5810. ab
  5811. No match
  5812. /X$/dollar_endonly
  5813. X
  5814. 0: X
  5815. \= Expect no match
  5816. X\n
  5817. No match
  5818. /X$/
  5819. X
  5820. 0: X
  5821. X\n
  5822. 0: X
  5823. /xyz/auto_callout
  5824. xyz
  5825. --->xyz
  5826. +0 ^ x
  5827. +1 ^^ y
  5828. +2 ^ ^ z
  5829. +3 ^ ^ End of pattern
  5830. 0: xyz
  5831. abcxyz
  5832. --->abcxyz
  5833. +0 ^ x
  5834. +1 ^^ y
  5835. +2 ^ ^ z
  5836. +3 ^ ^ End of pattern
  5837. 0: xyz
  5838. \= Expect no match
  5839. abc
  5840. No match
  5841. abcxypqr
  5842. No match
  5843. /xyz/auto_callout,no_start_optimize
  5844. abcxyz
  5845. --->abcxyz
  5846. +0 ^ x
  5847. +0 ^ x
  5848. +0 ^ x
  5849. +0 ^ x
  5850. +1 ^^ y
  5851. +2 ^ ^ z
  5852. +3 ^ ^ End of pattern
  5853. 0: xyz
  5854. \= Expect no match
  5855. abc
  5856. --->abc
  5857. +0 ^ x
  5858. +0 ^ x
  5859. +0 ^ x
  5860. +0 ^ x
  5861. No match
  5862. abcxypqr
  5863. --->abcxypqr
  5864. +0 ^ x
  5865. +0 ^ x
  5866. +0 ^ x
  5867. +0 ^ x
  5868. +1 ^^ y
  5869. +2 ^ ^ z
  5870. +0 ^ x
  5871. +0 ^ x
  5872. +0 ^ x
  5873. +0 ^ x
  5874. +0 ^ x
  5875. No match
  5876. /(*NO_START_OPT)xyz/auto_callout
  5877. abcxyz
  5878. --->abcxyz
  5879. +15 ^ x
  5880. +15 ^ x
  5881. +15 ^ x
  5882. +15 ^ x
  5883. +16 ^^ y
  5884. +17 ^ ^ z
  5885. +18 ^ ^ End of pattern
  5886. 0: xyz
  5887. /(?C)ab/
  5888. ab
  5889. --->ab
  5890. 0 ^ a
  5891. 0: ab
  5892. ab\=callout_none
  5893. 0: ab
  5894. /ab/auto_callout
  5895. ab
  5896. --->ab
  5897. +0 ^ a
  5898. +1 ^^ b
  5899. +2 ^ ^ End of pattern
  5900. 0: ab
  5901. ab\=callout_none
  5902. 0: ab
  5903. /^"((?(?=[a])[^"])|b)*"$/auto_callout
  5904. "ab"
  5905. --->"ab"
  5906. +0 ^ ^
  5907. +1 ^ "
  5908. +2 ^^ (
  5909. +21 ^^ "
  5910. +3 ^^ (?
  5911. +18 ^^ b
  5912. +5 ^^ (?=
  5913. +8 ^ [a]
  5914. +11 ^^ )
  5915. +12 ^^ [^"]
  5916. +16 ^ ^ )
  5917. +17 ^ ^ |
  5918. +21 ^ ^ "
  5919. +3 ^ ^ (?
  5920. +18 ^ ^ b
  5921. +5 ^ ^ (?=
  5922. +8 ^ [a]
  5923. +19 ^ ^ )*
  5924. +21 ^ ^ "
  5925. +3 ^ ^ (?
  5926. +18 ^ ^ b
  5927. +5 ^ ^ (?=
  5928. +8 ^ [a]
  5929. +17 ^ ^ |
  5930. +22 ^ ^ $
  5931. +23 ^ ^ End of pattern
  5932. 0: "ab"
  5933. "ab"\=callout_none
  5934. 0: "ab"
  5935. /\d+X|9+Y/
  5936. ++++123999\=ps
  5937. Partial match: 123999
  5938. ++++123999Y\=ps
  5939. 0: 999Y
  5940. /Z(*F)/
  5941. \= Expect no match
  5942. Z\=ps
  5943. No match
  5944. ZA\=ps
  5945. No match
  5946. /Z(?!)/
  5947. \= Expect no match
  5948. Z\=ps
  5949. No match
  5950. ZA\=ps
  5951. No match
  5952. /dog(sbody)?/
  5953. dogs\=ps
  5954. 0: dog
  5955. dogs\=ph
  5956. Partial match: dogs
  5957. /dog(sbody)??/
  5958. dogs\=ps
  5959. 0: dog
  5960. dogs\=ph
  5961. Partial match: dogs
  5962. /dog|dogsbody/
  5963. dogs\=ps
  5964. 0: dog
  5965. dogs\=ph
  5966. Partial match: dogs
  5967. /dogsbody|dog/
  5968. dogs\=ps
  5969. 0: dog
  5970. dogs\=ph
  5971. Partial match: dogs
  5972. /Z(*F)Q|ZXY/
  5973. Z\=ps
  5974. Partial match: Z
  5975. \= Expect no match
  5976. ZA\=ps
  5977. No match
  5978. X\=ps
  5979. No match
  5980. /\bthe cat\b/
  5981. the cat\=ps
  5982. 0: the cat
  5983. the cat\=ph
  5984. Partial match: the cat
  5985. /dog(sbody)?/
  5986. dogs\=ps
  5987. 0: dog
  5988. body\=dfa_restart
  5989. 0: body
  5990. /dog(sbody)?/
  5991. dogs\=ph
  5992. Partial match: dogs
  5993. body\=dfa_restart
  5994. 0: body
  5995. /abc/
  5996. abc\=ps
  5997. 0: abc
  5998. abc\=ph
  5999. 0: abc
  6000. /abc\K123/
  6001. xyzabc123pqr
  6002. Failed: error -42: pattern contains an item that is not supported for DFA matching
  6003. /(?<=abc)123/allusedtext
  6004. xyzabc123pqr
  6005. 0: abc123
  6006. <<<
  6007. xyzabc12\=ps
  6008. Partial match: abc12
  6009. <<<
  6010. xyzabc12\=ph
  6011. Partial match: abc12
  6012. <<<
  6013. /\babc\b/allusedtext
  6014. +++abc+++
  6015. 0: +abc+
  6016. < >
  6017. +++ab\=ps
  6018. Partial match: +ab
  6019. <
  6020. +++ab\=ph
  6021. Partial match: +ab
  6022. <
  6023. /(?=C)/g,aftertext
  6024. ABCDECBA
  6025. 0:
  6026. 0+ CDECBA
  6027. 0:
  6028. 0+ CBA
  6029. /(abc|def|xyz)/I
  6030. Capture group count = 1
  6031. Starting code units: a d x
  6032. Subject length lower bound = 3
  6033. terhjk;abcdaadsfe
  6034. 0: abc
  6035. the quick xyz brown fox
  6036. 0: xyz
  6037. \= Expect no match
  6038. thejk;adlfj aenjl;fda asdfasd ehj;kjxyasiupd
  6039. No match
  6040. /(abc|def|xyz)/I,no_start_optimize
  6041. Capture group count = 1
  6042. Options: no_start_optimize
  6043. terhjk;abcdaadsfe
  6044. 0: abc
  6045. the quick xyz brown fox
  6046. 0: xyz
  6047. \= Expect no match
  6048. thejk;adlfj aenjl;fda asdfasd ehj;kjxyasiupd
  6049. No match
  6050. /abcd*/aftertext
  6051. xxxxabcd\=ps
  6052. 0: abcd
  6053. 0+
  6054. xxxxabcd\=ph
  6055. Partial match: abcd
  6056. dddxxx\=dfa_restart
  6057. 0: ddd
  6058. 0+ xxx
  6059. xxxxabcd\=ph
  6060. Partial match: abcd
  6061. xxx\=dfa_restart
  6062. 0:
  6063. 0+ xxx
  6064. /abcd*/i
  6065. xxxxabcd\=ps
  6066. 0: abcd
  6067. xxxxabcd\=ph
  6068. Partial match: abcd
  6069. XXXXABCD\=ps
  6070. 0: ABCD
  6071. XXXXABCD\=ph
  6072. Partial match: ABCD
  6073. /abc\d*/
  6074. xxxxabc1\=ps
  6075. 0: abc1
  6076. xxxxabc1\=ph
  6077. Partial match: abc1
  6078. /abc[de]*/
  6079. xxxxabcde\=ps
  6080. 0: abcde
  6081. xxxxabcde\=ph
  6082. Partial match: abcde
  6083. /(?:(?1)|B)(A(*F)|C)/
  6084. ABCD
  6085. 0: BC
  6086. CCD
  6087. 0: CC
  6088. \= Expect no match
  6089. CAD
  6090. No match
  6091. /^(?:(?1)|B)(A(*F)|C)/
  6092. CCD
  6093. 0: CC
  6094. BCD
  6095. 0: BC
  6096. \= Expect no match
  6097. ABCD
  6098. No match
  6099. CAD
  6100. No match
  6101. BAD
  6102. No match
  6103. /^(?!a(*SKIP)b)/
  6104. ac
  6105. Failed: error -42: pattern contains an item that is not supported for DFA matching
  6106. /^(?=a(*SKIP)b|ac)/
  6107. ac
  6108. Failed: error -42: pattern contains an item that is not supported for DFA matching
  6109. /^(?=a(*THEN)b|ac)/
  6110. ac
  6111. Failed: error -42: pattern contains an item that is not supported for DFA matching
  6112. /^(?=a(*PRUNE)b)/
  6113. ab
  6114. Failed: error -42: pattern contains an item that is not supported for DFA matching
  6115. /^(?(?!a(*SKIP)b))/
  6116. ac
  6117. Failed: error -42: pattern contains an item that is not supported for DFA matching
  6118. /(?<=abc)def/allusedtext
  6119. abc\=ph
  6120. Partial match: abc
  6121. <<<
  6122. /abc$/
  6123. abc
  6124. 0: abc
  6125. abc\=ps
  6126. 0: abc
  6127. abc\=ph
  6128. Partial match: abc
  6129. /abc$/m
  6130. abc
  6131. 0: abc
  6132. abc\n
  6133. 0: abc
  6134. abc\=ph
  6135. Partial match: abc
  6136. abc\n\=ph
  6137. 0: abc
  6138. abc\=ps
  6139. 0: abc
  6140. abc\n\=ps
  6141. 0: abc
  6142. /abc\z/
  6143. abc
  6144. 0: abc
  6145. abc\=ps
  6146. 0: abc
  6147. abc\=ph
  6148. Partial match: abc
  6149. /abc\Z/
  6150. abc
  6151. 0: abc
  6152. abc\=ps
  6153. 0: abc
  6154. abc\=ph
  6155. Partial match: abc
  6156. /abc\b/
  6157. abc
  6158. 0: abc
  6159. abc\=ps
  6160. 0: abc
  6161. abc\=ph
  6162. Partial match: abc
  6163. /abc\B/
  6164. abc\=ps
  6165. Partial match: abc
  6166. abc\=ph
  6167. Partial match: abc
  6168. \= Expect no match
  6169. abc
  6170. No match
  6171. /.+/
  6172. abc\=offset=0
  6173. 0: abc
  6174. abc\=offset=1
  6175. 0: bc
  6176. abc\=offset=2
  6177. 0: c
  6178. \= Bad offsets
  6179. abc\=offset=4
  6180. Failed: error -33: bad offset value
  6181. abc\=offset=-4
  6182. ** Invalid value in 'offset=-4'
  6183. \= Expect no match
  6184. abc\=offset=3
  6185. No match
  6186. /^(?:a)++\w/
  6187. aaaab
  6188. 0: aaaab
  6189. \= Expect no match
  6190. aaaa
  6191. No match
  6192. bbb
  6193. No match
  6194. /^(?:aa|(?:a)++\w)/
  6195. aaaab
  6196. 0: aaaab
  6197. 1: aa
  6198. aaaa
  6199. 0: aa
  6200. \= Expect no match
  6201. bbb
  6202. No match
  6203. /^(?:a)*+\w/
  6204. aaaab
  6205. 0: aaaab
  6206. bbb
  6207. 0: b
  6208. \= Expect no match
  6209. aaaa
  6210. No match
  6211. /^(a)++\w/
  6212. aaaab
  6213. 0: aaaab
  6214. \= Expect no match
  6215. aaaa
  6216. No match
  6217. bbb
  6218. No match
  6219. /^(a|)++\w/
  6220. aaaab
  6221. 0: aaaab
  6222. \= Expect no match
  6223. aaaa
  6224. No match
  6225. bbb
  6226. No match
  6227. /(?=abc){3}abc/aftertext
  6228. abcabcabc
  6229. 0: abc
  6230. 0+ abcabc
  6231. \= Expect no match
  6232. xyz
  6233. No match
  6234. /(?=abc)+abc/aftertext
  6235. abcabcabc
  6236. 0: abc
  6237. 0+ abcabc
  6238. \= Expect no match
  6239. xyz
  6240. No match
  6241. /(?=abc)++abc/aftertext
  6242. abcabcabc
  6243. 0: abc
  6244. 0+ abcabc
  6245. \= Expect no match
  6246. xyz
  6247. No match
  6248. /(?=abc){0}xyz/
  6249. xyz
  6250. 0: xyz
  6251. /(?=abc){1}xyz/
  6252. \= Expect no match
  6253. xyz
  6254. No match
  6255. /(?=(a))?./
  6256. ab
  6257. 0: a
  6258. bc
  6259. 0: b
  6260. /(?=(a))??./
  6261. ab
  6262. 0: a
  6263. bc
  6264. 0: b
  6265. /^(?=(a)){0}b(?1)/
  6266. backgammon
  6267. 0: ba
  6268. /^(?=(?1))?[az]([abc])d/
  6269. abd
  6270. 0: abd
  6271. zcdxx
  6272. 0: zcd
  6273. /^(?!a){0}\w+/
  6274. aaaaa
  6275. 0: aaaaa
  6276. /(?<=(abc))?xyz/
  6277. abcxyz
  6278. 0: xyz
  6279. pqrxyz
  6280. 0: xyz
  6281. /((?2))((?1))/
  6282. abc
  6283. Failed: error -52: nested recursion at the same subject position
  6284. /(?(R)a+|(?R)b)/
  6285. aaaabcde
  6286. 0: aaaab
  6287. /(?(R)a+|((?R))b)/
  6288. aaaabcde
  6289. 0: aaaab
  6290. /((?(R)a+|(?1)b))/
  6291. aaaabcde
  6292. 0: aaaab
  6293. /((?(R2)a+|(?1)b))()/
  6294. aaaabcde
  6295. Failed: error -40: backreference condition or recursion test is not supported for DFA matching
  6296. /(?(R)a*(?1)|((?R))b)/
  6297. aaaabcde
  6298. Failed: error -52: nested recursion at the same subject position
  6299. /(a+)/no_auto_possess
  6300. aaaa\=ovector=3
  6301. Matched, but offsets vector is too small to show all matches
  6302. 0: aaaa
  6303. 1: aaa
  6304. 2: aa
  6305. aaaa\=ovector=4
  6306. 0: aaaa
  6307. 1: aaa
  6308. 2: aa
  6309. 3: a
  6310. /^\R/
  6311. \r\=ps
  6312. 0: \x0d
  6313. \r\=ph
  6314. Partial match: \x0d
  6315. /^\R{2,3}x/
  6316. \r\=ps
  6317. Partial match: \x0d
  6318. \r\=ph
  6319. Partial match: \x0d
  6320. \r\r\=ps
  6321. Partial match: \x0d\x0d
  6322. \r\r\=ph
  6323. Partial match: \x0d\x0d
  6324. \r\r\r\=ps
  6325. Partial match: \x0d\x0d\x0d
  6326. \r\r\r\=ph
  6327. Partial match: \x0d\x0d\x0d
  6328. \r\rx
  6329. 0: \x0d\x0dx
  6330. \r\r\rx
  6331. 0: \x0d\x0d\x0dx
  6332. /^\R{2,3}?x/
  6333. \r\=ps
  6334. Partial match: \x0d
  6335. \r\=ph
  6336. Partial match: \x0d
  6337. \r\r\=ps
  6338. Partial match: \x0d\x0d
  6339. \r\r\=ph
  6340. Partial match: \x0d\x0d
  6341. \r\r\r\=ps
  6342. Partial match: \x0d\x0d\x0d
  6343. \r\r\r\=ph
  6344. Partial match: \x0d\x0d\x0d
  6345. \r\rx
  6346. 0: \x0d\x0dx
  6347. \r\r\rx
  6348. 0: \x0d\x0d\x0dx
  6349. /^\R?x/
  6350. \r\=ps
  6351. Partial match: \x0d
  6352. \r\=ph
  6353. Partial match: \x0d
  6354. x
  6355. 0: x
  6356. \rx
  6357. 0: \x0dx
  6358. /^\R+x/
  6359. \r\=ps
  6360. Partial match: \x0d
  6361. \r\=ph
  6362. Partial match: \x0d
  6363. \r\n\=ps
  6364. Partial match: \x0d\x0a
  6365. \r\n\=ph
  6366. Partial match: \x0d\x0a
  6367. \rx
  6368. 0: \x0dx
  6369. /^a$/newline=crlf
  6370. a\r\=ps
  6371. Partial match: a\x0d
  6372. a\r\=ph
  6373. Partial match: a\x0d
  6374. /^a$/m,newline=crlf
  6375. a\r\=ps
  6376. Partial match: a\x0d
  6377. a\r\=ph
  6378. Partial match: a\x0d
  6379. /^(a$|a\r)/newline=crlf
  6380. a\r\=ps
  6381. 0: a\x0d
  6382. a\r\=ph
  6383. Partial match: a\x0d
  6384. /^(a$|a\r)/m,newline=crlf
  6385. a\r\=ps
  6386. 0: a\x0d
  6387. a\r\=ph
  6388. Partial match: a\x0d
  6389. /./newline=crlf
  6390. \r\=ps
  6391. 0: \x0d
  6392. \r\=ph
  6393. Partial match: \x0d
  6394. /.{2,3}/newline=crlf
  6395. \r\=ps
  6396. Partial match: \x0d
  6397. \r\=ph
  6398. Partial match: \x0d
  6399. \r\r\=ps
  6400. 0: \x0d\x0d
  6401. \r\r\=ph
  6402. Partial match: \x0d\x0d
  6403. \r\r\r\=ps
  6404. 0: \x0d\x0d\x0d
  6405. \r\r\r\=ph
  6406. Partial match: \x0d\x0d\x0d
  6407. /.{2,3}?/newline=crlf
  6408. \r\=ps
  6409. Partial match: \x0d
  6410. \r\=ph
  6411. Partial match: \x0d
  6412. \r\r\=ps
  6413. 0: \x0d\x0d
  6414. \r\r\=ph
  6415. Partial match: \x0d\x0d
  6416. \r\r\r\=ps
  6417. 0: \x0d\x0d\x0d
  6418. 1: \x0d\x0d
  6419. \r\r\r\=ph
  6420. Partial match: \x0d\x0d\x0d
  6421. # Test simple validity check for restarts
  6422. /abcdef/
  6423. abc\=dfa_restart
  6424. Failed: error -38: invalid data in workspace for DFA restart
  6425. /<H((?(?!<H|F>)(.)|(?R))++)*F>/
  6426. text <H more text <H texting more hexA0-"\xA0" hex above 7F-"\xBC" F> text xxxxx <H text F> text F> text2 <H text sample F> more text.
  6427. 0: <H more text <H texting more hexA0-"\xa0" hex above 7F-"\xbc" F> text xxxxx <H text F> text F>
  6428. /^(?>.{4})abc|^\w\w.xabcd/
  6429. xxxxabcd
  6430. 0: xxxxabcd
  6431. 1: xxxxabc
  6432. xx\xa0xabcd
  6433. 0: xx\xa0xabcd
  6434. 1: xx\xa0xabc
  6435. /^(.{4}){2}+abc|^\w\w.x\w\w\w\wabcd/
  6436. xxxxxxxxabcd
  6437. 0: xxxxxxxxabcd
  6438. 1: xxxxxxxxabc
  6439. xx\xa0xxxxxabcd
  6440. 0: xx\xa0xxxxxabcd
  6441. 1: xx\xa0xxxxxabc
  6442. /abcd/
  6443. abcd\=ovector=0
  6444. 0: abcd
  6445. # These tests show up auto-possessification
  6446. /[ab]*/
  6447. aaaa
  6448. 0: aaaa
  6449. /[ab]*?/
  6450. aaaa
  6451. 0: aaaa
  6452. 1: aaa
  6453. 2: aa
  6454. 3: a
  6455. 4:
  6456. /[ab]?/
  6457. aaaa
  6458. 0: a
  6459. /[ab]??/
  6460. aaaa
  6461. 0: a
  6462. 1:
  6463. /[ab]+/
  6464. aaaa
  6465. 0: aaaa
  6466. /[ab]+?/
  6467. aaaa
  6468. 0: aaaa
  6469. 1: aaa
  6470. 2: aa
  6471. 3: a
  6472. /[ab]{2,3}/
  6473. aaaa
  6474. 0: aaa
  6475. /[ab]{2,3}?/
  6476. aaaa
  6477. 0: aaa
  6478. 1: aa
  6479. /[ab]{2,}/
  6480. aaaa
  6481. 0: aaaa
  6482. /[ab]{2,}?/
  6483. aaaa
  6484. 0: aaaa
  6485. 1: aaa
  6486. 2: aa
  6487. '\A(?:[^\"]++|\"(?:[^\"]*+|\"\")*+\")++'
  6488. NON QUOTED \"QUOT\"\"ED\" AFTER \"NOT MATCHED
  6489. 0: NON QUOTED "QUOT""ED" AFTER
  6490. '\A(?:[^\"]++|\"(?:[^\"]++|\"\")*+\")++'
  6491. NON QUOTED \"QUOT\"\"ED\" AFTER \"NOT MATCHED
  6492. 0: NON QUOTED "QUOT""ED" AFTER
  6493. /abc(?=xyz)/allusedtext
  6494. abcxyzpqr
  6495. 0: abcxyz
  6496. >>>
  6497. abcxyzpqr\=aftertext
  6498. 0: abcxyz
  6499. >>>
  6500. 0+ xyzpqr
  6501. /(?<=pqr)abc(?=xyz)/allusedtext
  6502. xyzpqrabcxyzpqr
  6503. 0: pqrabcxyz
  6504. <<< >>>
  6505. xyzpqrabcxyzpqr\=aftertext
  6506. 0: pqrabcxyz
  6507. <<< >>>
  6508. 0+ xyzpqr
  6509. /a\b/
  6510. a.\=allusedtext
  6511. 0: a.
  6512. >
  6513. a\=allusedtext
  6514. 0: a
  6515. /abc(?=abcde)(?=ab)/allusedtext
  6516. abcabcdefg
  6517. 0: abcabcde
  6518. >>>>>
  6519. /a*?b*?/
  6520. ab
  6521. 0: ab
  6522. 1: a
  6523. 2:
  6524. /(*NOTEMPTY)a*?b*?/
  6525. ab
  6526. 0: ab
  6527. 1: a
  6528. ba
  6529. 0: b
  6530. cb
  6531. 0: b
  6532. /(*NOTEMPTY_ATSTART)a*?b*?/aftertext
  6533. ab
  6534. 0: ab
  6535. 0+
  6536. 1: a
  6537. cdab
  6538. 0:
  6539. 0+ dab
  6540. /(a)(b)|(c)/
  6541. XcX\=ovector=2,get=1,get=2,get=3,get=4,getall
  6542. 0: c
  6543. Get substring 1 failed (-55): requested value is not set
  6544. Get substring 2 failed (-54): requested value is not available
  6545. Get substring 3 failed (-54): requested value is not available
  6546. Get substring 4 failed (-54): requested value is not available
  6547. 0L c
  6548. /(?<A>aa)/
  6549. aa\=get=A
  6550. 0: aa
  6551. Get substring 'A' failed (-41): function is not supported for DFA matching
  6552. aa\=copy=A
  6553. 0: aa
  6554. Copy substring 'A' failed (-41): function is not supported for DFA matching
  6555. /a+/no_auto_possess
  6556. a\=ovector=2,get=1,get=2,getall
  6557. 0: a
  6558. Get substring 1 failed (-55): requested value is not set
  6559. Get substring 2 failed (-54): requested value is not available
  6560. 0L a
  6561. aaa\=ovector=2,get=1,get=2,getall
  6562. Matched, but offsets vector is too small to show all matches
  6563. 0: aaa
  6564. 1: aa
  6565. 1G aa (2)
  6566. Get substring 2 failed (-54): requested value is not available
  6567. 0L aaa
  6568. 1L aa
  6569. /a(b)c(d)/
  6570. abc\=ph,copy=0,copy=1,getall
  6571. Partial match: abc
  6572. 0C abc (3)
  6573. Copy substring 1 failed (-2): partial match
  6574. get substring list failed (-2): partial match
  6575. /ab(?C" any text with spaces ")cde/B
  6576. ------------------------------------------------------------------
  6577. Bra
  6578. ab
  6579. CalloutStr " any text with spaces " 6 30 1
  6580. cde
  6581. Ket
  6582. End
  6583. ------------------------------------------------------------------
  6584. abcde
  6585. Callout (6): " any text with spaces "
  6586. --->abcde
  6587. ^ ^ c
  6588. 0: abcde
  6589. 12abcde
  6590. Callout (6): " any text with spaces "
  6591. --->12abcde
  6592. ^ ^ c
  6593. 0: abcde
  6594. /^a(b)c(?C1)def/
  6595. abcdef
  6596. --->abcdef
  6597. 1 ^ ^ d
  6598. 0: abcdef
  6599. /^a(b)c(?C"AB")def/
  6600. abcdef
  6601. Callout (10): "AB"
  6602. --->abcdef
  6603. ^ ^ d
  6604. 0: abcdef
  6605. /^a(b)c(?C1)def/
  6606. abcdef\=callout_capture
  6607. Callout 1: last capture = 0
  6608. --->abcdef
  6609. ^ ^ d
  6610. 0: abcdef
  6611. /^a(b)c(?C{AB})def/B
  6612. ------------------------------------------------------------------
  6613. Bra
  6614. ^
  6615. a
  6616. CBra 1
  6617. b
  6618. Ket
  6619. c
  6620. CalloutStr {AB} 10 14 1
  6621. def
  6622. Ket
  6623. End
  6624. ------------------------------------------------------------------
  6625. abcdef\=callout_capture
  6626. Callout (10): {AB} last capture = 0
  6627. --->abcdef
  6628. ^ ^ d
  6629. 0: abcdef
  6630. /^(?(?C25)(?=abc)abcd|xyz)/B
  6631. ------------------------------------------------------------------
  6632. Bra
  6633. ^
  6634. Cond
  6635. Callout 25 9 3
  6636. Assert
  6637. abc
  6638. Ket
  6639. abcd
  6640. Alt
  6641. xyz
  6642. Ket
  6643. Ket
  6644. End
  6645. ------------------------------------------------------------------
  6646. abcdefg
  6647. --->abcdefg
  6648. 25 ^ (?=
  6649. 0: abcd
  6650. xyz123
  6651. --->xyz123
  6652. 25 ^ (?=
  6653. 0: xyz
  6654. /^(?(?C$abc$)(?=abc)abcd|xyz)/B
  6655. ------------------------------------------------------------------
  6656. Bra
  6657. ^
  6658. Cond
  6659. CalloutStr $abc$ 7 12 3
  6660. Assert
  6661. abc
  6662. Ket
  6663. abcd
  6664. Alt
  6665. xyz
  6666. Ket
  6667. Ket
  6668. End
  6669. ------------------------------------------------------------------
  6670. abcdefg
  6671. Callout (7): $abc$
  6672. --->abcdefg
  6673. ^ (?=
  6674. 0: abcd
  6675. xyz123
  6676. Callout (7): $abc$
  6677. --->xyz123
  6678. ^ (?=
  6679. 0: xyz
  6680. /^ab(?C'first')cd(?C"second")ef/
  6681. abcdefg
  6682. Callout (7): 'first'
  6683. --->abcdefg
  6684. ^ ^ c
  6685. Callout (20): "second"
  6686. --->abcdefg
  6687. ^ ^ e
  6688. 0: abcdef
  6689. /(?:a(?C`code`)){3}X/
  6690. aaaXY
  6691. Callout (8): `code`
  6692. --->aaaXY
  6693. ^^ ){3}
  6694. Callout (8): `code`
  6695. --->aaaXY
  6696. ^ ^ ){3}
  6697. Callout (8): `code`
  6698. --->aaaXY
  6699. ^ ^ ){3}
  6700. 0: aaaX
  6701. # Binary zero in callout string
  6702. /"a(?C'x" 00 "z')b"/hex
  6703. abcdefgh
  6704. Callout (5): 'x\x00z'
  6705. --->abcdefgh
  6706. ^^ b
  6707. 0: ab
  6708. /(?(?!)a|b)/
  6709. bbb
  6710. 0: b
  6711. \= Expect no match
  6712. aaa
  6713. No match
  6714. /^/gm
  6715. \n\n\n
  6716. 0:
  6717. 0:
  6718. 0:
  6719. /^/gm,alt_circumflex
  6720. \n\n\n
  6721. 0:
  6722. 0:
  6723. 0:
  6724. 0:
  6725. /abc/use_offset_limit
  6726. 1234abcde\=offset_limit=100
  6727. 0: abc
  6728. 1234abcde\=offset_limit=9
  6729. 0: abc
  6730. 1234abcde\=offset_limit=4
  6731. 0: abc
  6732. 1234abcde\=offset_limit=4,offset=4
  6733. 0: abc
  6734. \= Expect no match
  6735. 1234abcde\=offset_limit=4,offset=5
  6736. No match
  6737. 1234abcde\=offset_limit=3
  6738. No match
  6739. /(?<=abc)/use_offset_limit
  6740. 1234abc\=offset_limit=7
  6741. 0:
  6742. \= Expect no match
  6743. 1234abc\=offset_limit=6
  6744. No match
  6745. /abcd/null_context
  6746. abcd\=null_context
  6747. 0: abcd
  6748. /()()a+/no_auto_possess
  6749. aaa\=allcaptures
  6750. ** Ignored for DFA matching: allcaptures
  6751. 0: aaa
  6752. 1: aa
  6753. 2: a
  6754. a\=allcaptures
  6755. ** Ignored for DFA matching: allcaptures
  6756. 0: a
  6757. /(*LIMIT_DEPTH=100)^((.)(?1)|.)$/
  6758. \= Expect depth limit exceeded
  6759. a[00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]
  6760. Failed: error -53: matching depth limit exceeded
  6761. /(*LIMIT_HEAP=0)^((.)(?1)|.)$/
  6762. \= Expect heap limit exceeded
  6763. a[00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]
  6764. Failed: error -63: heap limit exceeded
  6765. /(*LIMIT_HEAP=50000)^((.)(?1)|.)$/
  6766. \= Expect success
  6767. a[00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]
  6768. 0: a[00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]
  6769. /(02-)?[0-9]{3}-[0-9]{3}/
  6770. 02-123-123
  6771. 0: 02-123-123
  6772. /^(a(?2))(b)(?1)/
  6773. abbab\=find_limits
  6774. Minimum heap limit = 0
  6775. Minimum match limit = 4
  6776. Minimum depth limit = 2
  6777. 0: abbab
  6778. /abc/endanchored
  6779. xyzabc
  6780. 0: abc
  6781. \= Expect no match
  6782. xyzabcdef
  6783. No match
  6784. \= Expect error
  6785. xyzabc\=ph
  6786. Failed: error -34: bad option value
  6787. /abc/
  6788. xyzabc\=endanchored
  6789. 0: abc
  6790. \= Expect no match
  6791. xyzabcdef\=endanchored
  6792. No match
  6793. \= Expect error
  6794. xyzabc\=ps,endanchored
  6795. Failed: error -34: bad option value
  6796. /abc|bcd/endanchored
  6797. xyzabcd
  6798. 0: bcd
  6799. \= Expect no match
  6800. xyzabcdef
  6801. No match
  6802. /(*NUL)^.*/
  6803. a\nb\x00ccc
  6804. 0: a\x0ab
  6805. /(*NUL)^.*/s
  6806. a\nb\x00ccc
  6807. 0: a\x0ab\x00ccc
  6808. /^x/m,newline=nul
  6809. ab\x00xy
  6810. 0: x
  6811. /'#comment' 0d 0a 00 '^x\' 0a 'y'/x,newline=nul,hex
  6812. x\nyz
  6813. 0: x\x0ay
  6814. /(*NUL)^X\NY/
  6815. X\nY
  6816. 0: X\x0aY
  6817. X\rY
  6818. 0: X\x0dY
  6819. \= Expect no match
  6820. X\x00Y
  6821. No match
  6822. /(?<=abc|)/
  6823. abcde\=aftertext
  6824. 0:
  6825. 0+ abcde
  6826. /(?<=|abc)/
  6827. abcde\=aftertext
  6828. 0:
  6829. 0+ abcde
  6830. /(?<=abc|)/endanchored
  6831. abcde\=aftertext
  6832. 0:
  6833. 0+
  6834. /(?<=|abc)/endanchored
  6835. abcde\=aftertext
  6836. 0:
  6837. 0+
  6838. /(*LIMIT_MATCH=100).*(?![|H]?.*(?![|H]?););.*(?![|H]?.*(?![|H]?););\x00\x00\x00\x00\x00\x00\x00(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?![|);)?.*(![|H]?);)?.*(?![|H]?);)?.*(?![|H]?);)?.*(?![|H]););![|H]?););[|H]?);|H]?);)\x00\x00\x00 \x00\x00\x00H]?););?![|H]?);)?.*(?![|H]?););[||H]?);)?.*(?![|H]?););[|H]?);(?![|H]?););![|H]?););[|H]?);|H]?);)?.*(?![|H]?););;[\x00\x00\x00\x00\x00\x00\x00![|H]?););![|H]?););[|H]?);|H]?);)?.*(?![|H]?););/no_dotstar_anchor
  6839. \= Expect limit exceeded
  6840. .*(?![|H]?.*(?![|H]?););.*(?![|H]?.*(?![|H]?););\x00\x00\x00\x00\x00\x00\x00(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?![|);)?.*(![|H]?);)?.*(?![|H]?);)?.*(?![|H]?);)?.*(?![|H]););![|H]?););[|H]?);|H]?);)\x00\x00\x00 \x00\x00\x00H]?););?![|H]?);)?.*(?![|H]?););[||H]?);)?.*(?![|H]?););[|H]?);(?![|H]?););![|H]?););[|H]?);|H]?);)?.*(?![|H]?););;[\x00\x00\x00\x00\x00\x00\x00![|H]?););![|H]?););[|H]?);|H]?);)?.*(?![|H]?););
  6841. Failed: error -47: match limit exceeded
  6842. /\n/firstline
  6843. xyz\nabc
  6844. 0: \x0a
  6845. /\nabc/firstline
  6846. xyz\nabc
  6847. 0: \x0aabc
  6848. /\x{0a}abc/firstline,newline=crlf
  6849. \= Expect no match
  6850. xyz\r\nabc
  6851. No match
  6852. /[abc]/firstline
  6853. \= Expect no match
  6854. \na
  6855. No match
  6856. /foobar/
  6857. the foobar thing\=copy_matched_subject
  6858. 0: foobar
  6859. the foobar thing\=copy_matched_subject,zero_terminate
  6860. 0: foobar
  6861. /foobar/g
  6862. the foobar thing foobar again\=copy_matched_subject
  6863. 0: foobar
  6864. 0: foobar
  6865. /(?(VERSION>=0)^B0W)/
  6866. B0W-W0W
  6867. 0: B0W
  6868. \= Expect no match
  6869. 0
  6870. No match
  6871. /(?(VERSION>=1000)^B0W|W0W)/
  6872. B0W-W0W
  6873. 0: W0W
  6874. \= Expect no match
  6875. 0
  6876. No match
  6877. /(?<=pqr)abc(?=xyz)/
  6878. 123pqrabcxy\=ps,allusedtext
  6879. Partial match: pqrabcxy
  6880. <<<
  6881. 123pqrabcxyz\=ps,allusedtext
  6882. 0: pqrabcxyz
  6883. <<< >>>
  6884. /(?>a+b)/
  6885. aaaa\=ps
  6886. Partial match: aaaa
  6887. aaaab\=ps
  6888. 0: aaaab
  6889. /(abc)(?1)/
  6890. abca\=ps
  6891. Partial match: abca
  6892. abcabc\=ps
  6893. 0: abcabc
  6894. /(?(?=abc).*|Z)/
  6895. ab\=ps
  6896. Partial match: ab
  6897. abcxyz\=ps
  6898. 0: abcxyz
  6899. /(abc)++x/
  6900. abcab\=ps
  6901. Partial match: abcab
  6902. abc\=ps
  6903. Partial match: abc
  6904. ab\=ps
  6905. Partial match: ab
  6906. abcx
  6907. 0: abcx
  6908. /\z/
  6909. abc\=ph
  6910. Partial match:
  6911. abc\=ps
  6912. 0:
  6913. /\Z/
  6914. abc\=ph
  6915. Partial match:
  6916. abc\=ps
  6917. 0:
  6918. abc\n\=ph
  6919. Partial match: \x0a
  6920. abc\n\=ps
  6921. 0:
  6922. /c*+(?<=[bc])/
  6923. abc\=ph
  6924. Partial match: c
  6925. ab\=ph
  6926. Partial match:
  6927. abc\=ps
  6928. 0: c
  6929. ab\=ps
  6930. 0:
  6931. /c++(?<=[bc])/
  6932. abc\=ph
  6933. Partial match: c
  6934. ab\=ph
  6935. Partial match:
  6936. /(?<=(?=.(?<=x)))/
  6937. abx
  6938. 0:
  6939. ab\=ph
  6940. Partial match:
  6941. bxyz
  6942. 0:
  6943. xyz
  6944. 0:
  6945. /(?![ab]).*/
  6946. ab\=ph
  6947. Partial match:
  6948. /c*+/
  6949. ab\=ph,offset=2
  6950. Partial match:
  6951. /
  6952. /anchored, firstline
  6953. \x0a
  6954. 0: \x0a
  6955. /
  6956. /anchored,firstline,no_start_optimize
  6957. \x0a
  6958. 0: \x0a
  6959. /
  6960. /firstline
  6961. \x0a
  6962. 0: \x0a
  6963. abc\x0adef
  6964. 0: \x0a
  6965. /|a(?0)/endanchored
  6966. aaaa
  6967. 0: aaaa
  6968. 1: aaa
  6969. 2: aa
  6970. 3: a
  6971. 4:
  6972. # End of testinput6