testinput1 98 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760
  1. /-- This set of tests is for features that are compatible with all versions of
  2. Perl >= 5.10, in non-UTF-8 mode. It should run clean for the 8-bit, 16-bit,
  3. and 32-bit PCRE libraries. --/
  4. < forbid 89?=ABCDEFfGILMNPTUWXZ<
  5. /the quick brown fox/
  6. the quick brown fox
  7. The quick brown FOX
  8. What do you know about the quick brown fox?
  9. What do you know about THE QUICK BROWN FOX?
  10. /The quick brown fox/i
  11. the quick brown fox
  12. The quick brown FOX
  13. What do you know about the quick brown fox?
  14. What do you know about THE QUICK BROWN FOX?
  15. /abcd\t\n\r\f\a\e\071\x3b\$\\\?caxyz/
  16. abcd\t\n\r\f\a\e9;\$\\?caxyz
  17. /a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/
  18. abxyzpqrrrabbxyyyypqAzz
  19. abxyzpqrrrabbxyyyypqAzz
  20. aabxyzpqrrrabbxyyyypqAzz
  21. aaabxyzpqrrrabbxyyyypqAzz
  22. aaaabxyzpqrrrabbxyyyypqAzz
  23. abcxyzpqrrrabbxyyyypqAzz
  24. aabcxyzpqrrrabbxyyyypqAzz
  25. aaabcxyzpqrrrabbxyyyypAzz
  26. aaabcxyzpqrrrabbxyyyypqAzz
  27. aaabcxyzpqrrrabbxyyyypqqAzz
  28. aaabcxyzpqrrrabbxyyyypqqqAzz
  29. aaabcxyzpqrrrabbxyyyypqqqqAzz
  30. aaabcxyzpqrrrabbxyyyypqqqqqAzz
  31. aaabcxyzpqrrrabbxyyyypqqqqqqAzz
  32. aaaabcxyzpqrrrabbxyyyypqAzz
  33. abxyzzpqrrrabbxyyyypqAzz
  34. aabxyzzzpqrrrabbxyyyypqAzz
  35. aaabxyzzzzpqrrrabbxyyyypqAzz
  36. aaaabxyzzzzpqrrrabbxyyyypqAzz
  37. abcxyzzpqrrrabbxyyyypqAzz
  38. aabcxyzzzpqrrrabbxyyyypqAzz
  39. aaabcxyzzzzpqrrrabbxyyyypqAzz
  40. aaaabcxyzzzzpqrrrabbxyyyypqAzz
  41. aaaabcxyzzzzpqrrrabbbxyyyypqAzz
  42. aaaabcxyzzzzpqrrrabbbxyyyyypqAzz
  43. aaabcxyzpqrrrabbxyyyypABzz
  44. aaabcxyzpqrrrabbxyyyypABBzz
  45. >>>aaabxyzpqrrrabbxyyyypqAzz
  46. >aaaabxyzpqrrrabbxyyyypqAzz
  47. >>>>abcxyzpqrrrabbxyyyypqAzz
  48. *** Failers
  49. abxyzpqrrabbxyyyypqAzz
  50. abxyzpqrrrrabbxyyyypqAzz
  51. abxyzpqrrrabxyyyypqAzz
  52. aaaabcxyzzzzpqrrrabbbxyyyyyypqAzz
  53. aaaabcxyzzzzpqrrrabbbxyyypqAzz
  54. aaabcxyzpqrrrabbxyyyypqqqqqqqAzz
  55. /^(abc){1,2}zz/
  56. abczz
  57. abcabczz
  58. *** Failers
  59. zz
  60. abcabcabczz
  61. >>abczz
  62. /^(b+?|a){1,2}?c/
  63. bc
  64. bbc
  65. bbbc
  66. bac
  67. bbac
  68. aac
  69. abbbbbbbbbbbc
  70. bbbbbbbbbbbac
  71. *** Failers
  72. aaac
  73. abbbbbbbbbbbac
  74. /^(b+|a){1,2}c/
  75. bc
  76. bbc
  77. bbbc
  78. bac
  79. bbac
  80. aac
  81. abbbbbbbbbbbc
  82. bbbbbbbbbbbac
  83. *** Failers
  84. aaac
  85. abbbbbbbbbbbac
  86. /^(b+|a){1,2}?bc/
  87. bbc
  88. /^(b*|ba){1,2}?bc/
  89. babc
  90. bbabc
  91. bababc
  92. *** Failers
  93. bababbc
  94. babababc
  95. /^(ba|b*){1,2}?bc/
  96. babc
  97. bbabc
  98. bababc
  99. *** Failers
  100. bababbc
  101. babababc
  102. /^\ca\cA\c[;\c:/
  103. \x01\x01\e;z
  104. /^[ab\]cde]/
  105. athing
  106. bthing
  107. ]thing
  108. cthing
  109. dthing
  110. ething
  111. *** Failers
  112. fthing
  113. [thing
  114. \\thing
  115. /^[]cde]/
  116. ]thing
  117. cthing
  118. dthing
  119. ething
  120. *** Failers
  121. athing
  122. fthing
  123. /^[^ab\]cde]/
  124. fthing
  125. [thing
  126. \\thing
  127. *** Failers
  128. athing
  129. bthing
  130. ]thing
  131. cthing
  132. dthing
  133. ething
  134. /^[^]cde]/
  135. athing
  136. fthing
  137. *** Failers
  138. ]thing
  139. cthing
  140. dthing
  141. ething
  142. /^\�/
  143. /^ÿ/
  144. ÿ
  145. /^[0-9]+$/
  146. 0
  147. 1
  148. 2
  149. 3
  150. 4
  151. 5
  152. 6
  153. 7
  154. 8
  155. 9
  156. 10
  157. 100
  158. *** Failers
  159. abc
  160. /^.*nter/
  161. enter
  162. inter
  163. uponter
  164. /^xxx[0-9]+$/
  165. xxx0
  166. xxx1234
  167. *** Failers
  168. xxx
  169. /^.+[0-9][0-9][0-9]$/
  170. x123
  171. xx123
  172. 123456
  173. *** Failers
  174. 123
  175. x1234
  176. /^.+?[0-9][0-9][0-9]$/
  177. x123
  178. xx123
  179. 123456
  180. *** Failers
  181. 123
  182. x1234
  183. /^([^!]+)!(.+)=apquxz\.ixr\.zzz\.ac\.uk$/
  184. abc!pqr=apquxz.ixr.zzz.ac.uk
  185. *** Failers
  186. !pqr=apquxz.ixr.zzz.ac.uk
  187. abc!=apquxz.ixr.zzz.ac.uk
  188. abc!pqr=apquxz:ixr.zzz.ac.uk
  189. abc!pqr=apquxz.ixr.zzz.ac.ukk
  190. /:/
  191. Well, we need a colon: somewhere
  192. *** Fail if we don't
  193. /([\da-f:]+)$/i
  194. 0abc
  195. abc
  196. fed
  197. E
  198. ::
  199. 5f03:12C0::932e
  200. fed def
  201. Any old stuff
  202. *** Failers
  203. 0zzz
  204. gzzz
  205. fed\x20
  206. Any old rubbish
  207. /^.*\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/
  208. .1.2.3
  209. A.12.123.0
  210. *** Failers
  211. .1.2.3333
  212. 1.2.3
  213. 1234.2.3
  214. /^(\d+)\s+IN\s+SOA\s+(\S+)\s+(\S+)\s*\(\s*$/
  215. 1 IN SOA non-sp1 non-sp2(
  216. 1 IN SOA non-sp1 non-sp2 (
  217. *** Failers
  218. 1IN SOA non-sp1 non-sp2(
  219. /^[a-zA-Z\d][a-zA-Z\d\-]*(\.[a-zA-Z\d][a-zA-z\d\-]*)*\.$/
  220. a.
  221. Z.
  222. 2.
  223. ab-c.pq-r.
  224. sxk.zzz.ac.uk.
  225. x-.y-.
  226. *** Failers
  227. -abc.peq.
  228. /^\*\.[a-z]([a-z\-\d]*[a-z\d]+)?(\.[a-z]([a-z\-\d]*[a-z\d]+)?)*$/
  229. *.a
  230. *.b0-a
  231. *.c3-b.c
  232. *.c-a.b-c
  233. *** Failers
  234. *.0
  235. *.a-
  236. *.a-b.c-
  237. *.c-a.0-c
  238. /^(?=ab(de))(abd)(e)/
  239. abde
  240. /^(?!(ab)de|x)(abd)(f)/
  241. abdf
  242. /^(?=(ab(cd)))(ab)/
  243. abcd
  244. /^[\da-f](\.[\da-f])*$/i
  245. a.b.c.d
  246. A.B.C.D
  247. a.b.c.1.2.3.C
  248. /^\".*\"\s*(;.*)?$/
  249. \"1234\"
  250. \"abcd\" ;
  251. \"\" ; rhubarb
  252. *** Failers
  253. \"1234\" : things
  254. /^$/
  255. \
  256. *** Failers
  257. / ^ a (?# begins with a) b\sc (?# then b c) $ (?# then end)/x
  258. ab c
  259. *** Failers
  260. abc
  261. ab cde
  262. /(?x) ^ a (?# begins with a) b\sc (?# then b c) $ (?# then end)/
  263. ab c
  264. *** Failers
  265. abc
  266. ab cde
  267. /^ a\ b[c ]d $/x
  268. a bcd
  269. a b d
  270. *** Failers
  271. abcd
  272. ab d
  273. /^(a(b(c)))(d(e(f)))(h(i(j)))(k(l(m)))$/
  274. abcdefhijklm
  275. /^(?:a(b(c)))(?:d(e(f)))(?:h(i(j)))(?:k(l(m)))$/
  276. abcdefhijklm
  277. /^[\w][\W][\s][\S][\d][\D][\b][\n][\c]][\022]/
  278. a+ Z0+\x08\n\x1d\x12
  279. /^[.^$|()*+?{,}]+/
  280. .^\$(*+)|{?,?}
  281. /^a*\w/
  282. z
  283. az
  284. aaaz
  285. a
  286. aa
  287. aaaa
  288. a+
  289. aa+
  290. /^a*?\w/
  291. z
  292. az
  293. aaaz
  294. a
  295. aa
  296. aaaa
  297. a+
  298. aa+
  299. /^a+\w/
  300. az
  301. aaaz
  302. aa
  303. aaaa
  304. aa+
  305. /^a+?\w/
  306. az
  307. aaaz
  308. aa
  309. aaaa
  310. aa+
  311. /^\d{8}\w{2,}/
  312. 1234567890
  313. 12345678ab
  314. 12345678__
  315. *** Failers
  316. 1234567
  317. /^[aeiou\d]{4,5}$/
  318. uoie
  319. 1234
  320. 12345
  321. aaaaa
  322. *** Failers
  323. 123456
  324. /^[aeiou\d]{4,5}?/
  325. uoie
  326. 1234
  327. 12345
  328. aaaaa
  329. 123456
  330. /\A(abc|def)=(\1){2,3}\Z/
  331. abc=abcabc
  332. def=defdefdef
  333. *** Failers
  334. abc=defdef
  335. /^(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)\11*(\3\4)\1(?#)2$/
  336. abcdefghijkcda2
  337. abcdefghijkkkkcda2
  338. /(cat(a(ract|tonic)|erpillar)) \1()2(3)/
  339. cataract cataract23
  340. catatonic catatonic23
  341. caterpillar caterpillar23
  342. /^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]/
  343. From abcd Mon Sep 01 12:33:02 1997
  344. /^From\s+\S+\s+([a-zA-Z]{3}\s+){2}\d{1,2}\s+\d\d:\d\d/
  345. From abcd Mon Sep 01 12:33:02 1997
  346. From abcd Mon Sep 1 12:33:02 1997
  347. *** Failers
  348. From abcd Sep 01 12:33:02 1997
  349. /^12.34/s
  350. 12\n34
  351. 12\r34
  352. /\w+(?=\t)/
  353. the quick brown\t fox
  354. /foo(?!bar)(.*)/
  355. foobar is foolish see?
  356. /(?:(?!foo)...|^.{0,2})bar(.*)/
  357. foobar crowbar etc
  358. barrel
  359. 2barrel
  360. A barrel
  361. /^(\D*)(?=\d)(?!123)/
  362. abc456
  363. *** Failers
  364. abc123
  365. /^1234(?# test newlines
  366. inside)/
  367. 1234
  368. /^1234 #comment in extended re
  369. /x
  370. 1234
  371. /#rhubarb
  372. abcd/x
  373. abcd
  374. /^abcd#rhubarb/x
  375. abcd
  376. /^(a)\1{2,3}(.)/
  377. aaab
  378. aaaab
  379. aaaaab
  380. aaaaaab
  381. /(?!^)abc/
  382. the abc
  383. *** Failers
  384. abc
  385. /(?=^)abc/
  386. abc
  387. *** Failers
  388. the abc
  389. /^[ab]{1,3}(ab*|b)/
  390. aabbbbb
  391. /^[ab]{1,3}?(ab*|b)/
  392. aabbbbb
  393. /^[ab]{1,3}?(ab*?|b)/
  394. aabbbbb
  395. /^[ab]{1,3}(ab*?|b)/
  396. aabbbbb
  397. / (?: [\040\t] | \(
  398. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  399. \) )* # optional leading comment
  400. (?: (?:
  401. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  402. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  403. |
  404. " (?: # opening quote...
  405. [^\\\x80-\xff\n\015"] # Anything except backslash and quote
  406. | # or
  407. \\ [^\x80-\xff] # Escaped something (something != CR)
  408. )* " # closing quote
  409. ) # initial word
  410. (?: (?: [\040\t] | \(
  411. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  412. \) )* \. (?: [\040\t] | \(
  413. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  414. \) )* (?:
  415. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  416. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  417. |
  418. " (?: # opening quote...
  419. [^\\\x80-\xff\n\015"] # Anything except backslash and quote
  420. | # or
  421. \\ [^\x80-\xff] # Escaped something (something != CR)
  422. )* " # closing quote
  423. ) )* # further okay, if led by a period
  424. (?: [\040\t] | \(
  425. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  426. \) )* @ (?: [\040\t] | \(
  427. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  428. \) )* (?:
  429. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  430. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  431. | \[ # [
  432. (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
  433. \] # ]
  434. ) # initial subdomain
  435. (?: #
  436. (?: [\040\t] | \(
  437. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  438. \) )* \. # if led by a period...
  439. (?: [\040\t] | \(
  440. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  441. \) )* (?:
  442. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  443. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  444. | \[ # [
  445. (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
  446. \] # ]
  447. ) # ...further okay
  448. )*
  449. # address
  450. | # or
  451. (?:
  452. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  453. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  454. |
  455. " (?: # opening quote...
  456. [^\\\x80-\xff\n\015"] # Anything except backslash and quote
  457. | # or
  458. \\ [^\x80-\xff] # Escaped something (something != CR)
  459. )* " # closing quote
  460. ) # one word, optionally followed by....
  461. (?:
  462. [^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037] | # atom and space parts, or...
  463. \(
  464. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  465. \) | # comments, or...
  466. " (?: # opening quote...
  467. [^\\\x80-\xff\n\015"] # Anything except backslash and quote
  468. | # or
  469. \\ [^\x80-\xff] # Escaped something (something != CR)
  470. )* " # closing quote
  471. # quoted strings
  472. )*
  473. < (?: [\040\t] | \(
  474. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  475. \) )* # leading <
  476. (?: @ (?: [\040\t] | \(
  477. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  478. \) )* (?:
  479. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  480. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  481. | \[ # [
  482. (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
  483. \] # ]
  484. ) # initial subdomain
  485. (?: #
  486. (?: [\040\t] | \(
  487. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  488. \) )* \. # if led by a period...
  489. (?: [\040\t] | \(
  490. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  491. \) )* (?:
  492. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  493. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  494. | \[ # [
  495. (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
  496. \] # ]
  497. ) # ...further okay
  498. )*
  499. (?: (?: [\040\t] | \(
  500. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  501. \) )* , (?: [\040\t] | \(
  502. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  503. \) )* @ (?: [\040\t] | \(
  504. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  505. \) )* (?:
  506. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  507. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  508. | \[ # [
  509. (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
  510. \] # ]
  511. ) # initial subdomain
  512. (?: #
  513. (?: [\040\t] | \(
  514. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  515. \) )* \. # if led by a period...
  516. (?: [\040\t] | \(
  517. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  518. \) )* (?:
  519. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  520. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  521. | \[ # [
  522. (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
  523. \] # ]
  524. ) # ...further okay
  525. )*
  526. )* # further okay, if led by comma
  527. : # closing colon
  528. (?: [\040\t] | \(
  529. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  530. \) )* )? # optional route
  531. (?:
  532. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  533. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  534. |
  535. " (?: # opening quote...
  536. [^\\\x80-\xff\n\015"] # Anything except backslash and quote
  537. | # or
  538. \\ [^\x80-\xff] # Escaped something (something != CR)
  539. )* " # closing quote
  540. ) # initial word
  541. (?: (?: [\040\t] | \(
  542. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  543. \) )* \. (?: [\040\t] | \(
  544. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  545. \) )* (?:
  546. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  547. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  548. |
  549. " (?: # opening quote...
  550. [^\\\x80-\xff\n\015"] # Anything except backslash and quote
  551. | # or
  552. \\ [^\x80-\xff] # Escaped something (something != CR)
  553. )* " # closing quote
  554. ) )* # further okay, if led by a period
  555. (?: [\040\t] | \(
  556. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  557. \) )* @ (?: [\040\t] | \(
  558. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  559. \) )* (?:
  560. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  561. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  562. | \[ # [
  563. (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
  564. \] # ]
  565. ) # initial subdomain
  566. (?: #
  567. (?: [\040\t] | \(
  568. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  569. \) )* \. # if led by a period...
  570. (?: [\040\t] | \(
  571. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  572. \) )* (?:
  573. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  574. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  575. | \[ # [
  576. (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
  577. \] # ]
  578. ) # ...further okay
  579. )*
  580. # address spec
  581. (?: [\040\t] | \(
  582. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  583. \) )* > # trailing >
  584. # name and address
  585. ) (?: [\040\t] | \(
  586. (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )*
  587. \) )* # optional trailing comment
  588. /x
  589. Alan Other <user\@dom.ain>
  590. <user\@dom.ain>
  591. user\@dom.ain
  592. \"A. Other\" <user.1234\@dom.ain> (a comment)
  593. A. Other <user.1234\@dom.ain> (a comment)
  594. \"/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/\"\@x400-re.lay
  595. A missing angle <user\@some.where
  596. *** Failers
  597. The quick brown fox
  598. /[\040\t]* # Nab whitespace.
  599. (?:
  600. \( # (
  601. [^\\\x80-\xff\n\015()] * # normal*
  602. (?: # (
  603. (?: \\ [^\x80-\xff] |
  604. \( # (
  605. [^\\\x80-\xff\n\015()] * # normal*
  606. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  607. \) # )
  608. ) # special
  609. [^\\\x80-\xff\n\015()] * # normal*
  610. )* # )*
  611. \) # )
  612. [\040\t]* )* # If comment found, allow more spaces.
  613. # optional leading comment
  614. (?:
  615. (?:
  616. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  617. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  618. # Atom
  619. | # or
  620. " # "
  621. [^\\\x80-\xff\n\015"] * # normal
  622. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )*
  623. " # "
  624. # Quoted string
  625. )
  626. [\040\t]* # Nab whitespace.
  627. (?:
  628. \( # (
  629. [^\\\x80-\xff\n\015()] * # normal*
  630. (?: # (
  631. (?: \\ [^\x80-\xff] |
  632. \( # (
  633. [^\\\x80-\xff\n\015()] * # normal*
  634. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  635. \) # )
  636. ) # special
  637. [^\\\x80-\xff\n\015()] * # normal*
  638. )* # )*
  639. \) # )
  640. [\040\t]* )* # If comment found, allow more spaces.
  641. (?:
  642. \.
  643. [\040\t]* # Nab whitespace.
  644. (?:
  645. \( # (
  646. [^\\\x80-\xff\n\015()] * # normal*
  647. (?: # (
  648. (?: \\ [^\x80-\xff] |
  649. \( # (
  650. [^\\\x80-\xff\n\015()] * # normal*
  651. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  652. \) # )
  653. ) # special
  654. [^\\\x80-\xff\n\015()] * # normal*
  655. )* # )*
  656. \) # )
  657. [\040\t]* )* # If comment found, allow more spaces.
  658. (?:
  659. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  660. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  661. # Atom
  662. | # or
  663. " # "
  664. [^\\\x80-\xff\n\015"] * # normal
  665. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )*
  666. " # "
  667. # Quoted string
  668. )
  669. [\040\t]* # Nab whitespace.
  670. (?:
  671. \( # (
  672. [^\\\x80-\xff\n\015()] * # normal*
  673. (?: # (
  674. (?: \\ [^\x80-\xff] |
  675. \( # (
  676. [^\\\x80-\xff\n\015()] * # normal*
  677. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  678. \) # )
  679. ) # special
  680. [^\\\x80-\xff\n\015()] * # normal*
  681. )* # )*
  682. \) # )
  683. [\040\t]* )* # If comment found, allow more spaces.
  684. # additional words
  685. )*
  686. @
  687. [\040\t]* # Nab whitespace.
  688. (?:
  689. \( # (
  690. [^\\\x80-\xff\n\015()] * # normal*
  691. (?: # (
  692. (?: \\ [^\x80-\xff] |
  693. \( # (
  694. [^\\\x80-\xff\n\015()] * # normal*
  695. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  696. \) # )
  697. ) # special
  698. [^\\\x80-\xff\n\015()] * # normal*
  699. )* # )*
  700. \) # )
  701. [\040\t]* )* # If comment found, allow more spaces.
  702. (?:
  703. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  704. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  705. |
  706. \[ # [
  707. (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
  708. \] # ]
  709. )
  710. [\040\t]* # Nab whitespace.
  711. (?:
  712. \( # (
  713. [^\\\x80-\xff\n\015()] * # normal*
  714. (?: # (
  715. (?: \\ [^\x80-\xff] |
  716. \( # (
  717. [^\\\x80-\xff\n\015()] * # normal*
  718. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  719. \) # )
  720. ) # special
  721. [^\\\x80-\xff\n\015()] * # normal*
  722. )* # )*
  723. \) # )
  724. [\040\t]* )* # If comment found, allow more spaces.
  725. # optional trailing comments
  726. (?:
  727. \.
  728. [\040\t]* # Nab whitespace.
  729. (?:
  730. \( # (
  731. [^\\\x80-\xff\n\015()] * # normal*
  732. (?: # (
  733. (?: \\ [^\x80-\xff] |
  734. \( # (
  735. [^\\\x80-\xff\n\015()] * # normal*
  736. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  737. \) # )
  738. ) # special
  739. [^\\\x80-\xff\n\015()] * # normal*
  740. )* # )*
  741. \) # )
  742. [\040\t]* )* # If comment found, allow more spaces.
  743. (?:
  744. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  745. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  746. |
  747. \[ # [
  748. (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
  749. \] # ]
  750. )
  751. [\040\t]* # Nab whitespace.
  752. (?:
  753. \( # (
  754. [^\\\x80-\xff\n\015()] * # normal*
  755. (?: # (
  756. (?: \\ [^\x80-\xff] |
  757. \( # (
  758. [^\\\x80-\xff\n\015()] * # normal*
  759. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  760. \) # )
  761. ) # special
  762. [^\\\x80-\xff\n\015()] * # normal*
  763. )* # )*
  764. \) # )
  765. [\040\t]* )* # If comment found, allow more spaces.
  766. # optional trailing comments
  767. )*
  768. # address
  769. | # or
  770. (?:
  771. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  772. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  773. # Atom
  774. | # or
  775. " # "
  776. [^\\\x80-\xff\n\015"] * # normal
  777. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )*
  778. " # "
  779. # Quoted string
  780. )
  781. # leading word
  782. [^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037] * # "normal" atoms and or spaces
  783. (?:
  784. (?:
  785. \( # (
  786. [^\\\x80-\xff\n\015()] * # normal*
  787. (?: # (
  788. (?: \\ [^\x80-\xff] |
  789. \( # (
  790. [^\\\x80-\xff\n\015()] * # normal*
  791. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  792. \) # )
  793. ) # special
  794. [^\\\x80-\xff\n\015()] * # normal*
  795. )* # )*
  796. \) # )
  797. |
  798. " # "
  799. [^\\\x80-\xff\n\015"] * # normal
  800. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )*
  801. " # "
  802. ) # "special" comment or quoted string
  803. [^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037] * # more "normal"
  804. )*
  805. <
  806. [\040\t]* # Nab whitespace.
  807. (?:
  808. \( # (
  809. [^\\\x80-\xff\n\015()] * # normal*
  810. (?: # (
  811. (?: \\ [^\x80-\xff] |
  812. \( # (
  813. [^\\\x80-\xff\n\015()] * # normal*
  814. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  815. \) # )
  816. ) # special
  817. [^\\\x80-\xff\n\015()] * # normal*
  818. )* # )*
  819. \) # )
  820. [\040\t]* )* # If comment found, allow more spaces.
  821. # <
  822. (?:
  823. @
  824. [\040\t]* # Nab whitespace.
  825. (?:
  826. \( # (
  827. [^\\\x80-\xff\n\015()] * # normal*
  828. (?: # (
  829. (?: \\ [^\x80-\xff] |
  830. \( # (
  831. [^\\\x80-\xff\n\015()] * # normal*
  832. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  833. \) # )
  834. ) # special
  835. [^\\\x80-\xff\n\015()] * # normal*
  836. )* # )*
  837. \) # )
  838. [\040\t]* )* # If comment found, allow more spaces.
  839. (?:
  840. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  841. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  842. |
  843. \[ # [
  844. (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
  845. \] # ]
  846. )
  847. [\040\t]* # Nab whitespace.
  848. (?:
  849. \( # (
  850. [^\\\x80-\xff\n\015()] * # normal*
  851. (?: # (
  852. (?: \\ [^\x80-\xff] |
  853. \( # (
  854. [^\\\x80-\xff\n\015()] * # normal*
  855. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  856. \) # )
  857. ) # special
  858. [^\\\x80-\xff\n\015()] * # normal*
  859. )* # )*
  860. \) # )
  861. [\040\t]* )* # If comment found, allow more spaces.
  862. # optional trailing comments
  863. (?:
  864. \.
  865. [\040\t]* # Nab whitespace.
  866. (?:
  867. \( # (
  868. [^\\\x80-\xff\n\015()] * # normal*
  869. (?: # (
  870. (?: \\ [^\x80-\xff] |
  871. \( # (
  872. [^\\\x80-\xff\n\015()] * # normal*
  873. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  874. \) # )
  875. ) # special
  876. [^\\\x80-\xff\n\015()] * # normal*
  877. )* # )*
  878. \) # )
  879. [\040\t]* )* # If comment found, allow more spaces.
  880. (?:
  881. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  882. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  883. |
  884. \[ # [
  885. (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
  886. \] # ]
  887. )
  888. [\040\t]* # Nab whitespace.
  889. (?:
  890. \( # (
  891. [^\\\x80-\xff\n\015()] * # normal*
  892. (?: # (
  893. (?: \\ [^\x80-\xff] |
  894. \( # (
  895. [^\\\x80-\xff\n\015()] * # normal*
  896. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  897. \) # )
  898. ) # special
  899. [^\\\x80-\xff\n\015()] * # normal*
  900. )* # )*
  901. \) # )
  902. [\040\t]* )* # If comment found, allow more spaces.
  903. # optional trailing comments
  904. )*
  905. (?: ,
  906. [\040\t]* # Nab whitespace.
  907. (?:
  908. \( # (
  909. [^\\\x80-\xff\n\015()] * # normal*
  910. (?: # (
  911. (?: \\ [^\x80-\xff] |
  912. \( # (
  913. [^\\\x80-\xff\n\015()] * # normal*
  914. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  915. \) # )
  916. ) # special
  917. [^\\\x80-\xff\n\015()] * # normal*
  918. )* # )*
  919. \) # )
  920. [\040\t]* )* # If comment found, allow more spaces.
  921. @
  922. [\040\t]* # Nab whitespace.
  923. (?:
  924. \( # (
  925. [^\\\x80-\xff\n\015()] * # normal*
  926. (?: # (
  927. (?: \\ [^\x80-\xff] |
  928. \( # (
  929. [^\\\x80-\xff\n\015()] * # normal*
  930. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  931. \) # )
  932. ) # special
  933. [^\\\x80-\xff\n\015()] * # normal*
  934. )* # )*
  935. \) # )
  936. [\040\t]* )* # If comment found, allow more spaces.
  937. (?:
  938. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  939. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  940. |
  941. \[ # [
  942. (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
  943. \] # ]
  944. )
  945. [\040\t]* # Nab whitespace.
  946. (?:
  947. \( # (
  948. [^\\\x80-\xff\n\015()] * # normal*
  949. (?: # (
  950. (?: \\ [^\x80-\xff] |
  951. \( # (
  952. [^\\\x80-\xff\n\015()] * # normal*
  953. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  954. \) # )
  955. ) # special
  956. [^\\\x80-\xff\n\015()] * # normal*
  957. )* # )*
  958. \) # )
  959. [\040\t]* )* # If comment found, allow more spaces.
  960. # optional trailing comments
  961. (?:
  962. \.
  963. [\040\t]* # Nab whitespace.
  964. (?:
  965. \( # (
  966. [^\\\x80-\xff\n\015()] * # normal*
  967. (?: # (
  968. (?: \\ [^\x80-\xff] |
  969. \( # (
  970. [^\\\x80-\xff\n\015()] * # normal*
  971. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  972. \) # )
  973. ) # special
  974. [^\\\x80-\xff\n\015()] * # normal*
  975. )* # )*
  976. \) # )
  977. [\040\t]* )* # If comment found, allow more spaces.
  978. (?:
  979. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  980. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  981. |
  982. \[ # [
  983. (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
  984. \] # ]
  985. )
  986. [\040\t]* # Nab whitespace.
  987. (?:
  988. \( # (
  989. [^\\\x80-\xff\n\015()] * # normal*
  990. (?: # (
  991. (?: \\ [^\x80-\xff] |
  992. \( # (
  993. [^\\\x80-\xff\n\015()] * # normal*
  994. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  995. \) # )
  996. ) # special
  997. [^\\\x80-\xff\n\015()] * # normal*
  998. )* # )*
  999. \) # )
  1000. [\040\t]* )* # If comment found, allow more spaces.
  1001. # optional trailing comments
  1002. )*
  1003. )* # additional domains
  1004. :
  1005. [\040\t]* # Nab whitespace.
  1006. (?:
  1007. \( # (
  1008. [^\\\x80-\xff\n\015()] * # normal*
  1009. (?: # (
  1010. (?: \\ [^\x80-\xff] |
  1011. \( # (
  1012. [^\\\x80-\xff\n\015()] * # normal*
  1013. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  1014. \) # )
  1015. ) # special
  1016. [^\\\x80-\xff\n\015()] * # normal*
  1017. )* # )*
  1018. \) # )
  1019. [\040\t]* )* # If comment found, allow more spaces.
  1020. # optional trailing comments
  1021. )? # optional route
  1022. (?:
  1023. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  1024. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  1025. # Atom
  1026. | # or
  1027. " # "
  1028. [^\\\x80-\xff\n\015"] * # normal
  1029. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )*
  1030. " # "
  1031. # Quoted string
  1032. )
  1033. [\040\t]* # Nab whitespace.
  1034. (?:
  1035. \( # (
  1036. [^\\\x80-\xff\n\015()] * # normal*
  1037. (?: # (
  1038. (?: \\ [^\x80-\xff] |
  1039. \( # (
  1040. [^\\\x80-\xff\n\015()] * # normal*
  1041. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  1042. \) # )
  1043. ) # special
  1044. [^\\\x80-\xff\n\015()] * # normal*
  1045. )* # )*
  1046. \) # )
  1047. [\040\t]* )* # If comment found, allow more spaces.
  1048. (?:
  1049. \.
  1050. [\040\t]* # Nab whitespace.
  1051. (?:
  1052. \( # (
  1053. [^\\\x80-\xff\n\015()] * # normal*
  1054. (?: # (
  1055. (?: \\ [^\x80-\xff] |
  1056. \( # (
  1057. [^\\\x80-\xff\n\015()] * # normal*
  1058. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  1059. \) # )
  1060. ) # special
  1061. [^\\\x80-\xff\n\015()] * # normal*
  1062. )* # )*
  1063. \) # )
  1064. [\040\t]* )* # If comment found, allow more spaces.
  1065. (?:
  1066. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  1067. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  1068. # Atom
  1069. | # or
  1070. " # "
  1071. [^\\\x80-\xff\n\015"] * # normal
  1072. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )*
  1073. " # "
  1074. # Quoted string
  1075. )
  1076. [\040\t]* # Nab whitespace.
  1077. (?:
  1078. \( # (
  1079. [^\\\x80-\xff\n\015()] * # normal*
  1080. (?: # (
  1081. (?: \\ [^\x80-\xff] |
  1082. \( # (
  1083. [^\\\x80-\xff\n\015()] * # normal*
  1084. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  1085. \) # )
  1086. ) # special
  1087. [^\\\x80-\xff\n\015()] * # normal*
  1088. )* # )*
  1089. \) # )
  1090. [\040\t]* )* # If comment found, allow more spaces.
  1091. # additional words
  1092. )*
  1093. @
  1094. [\040\t]* # Nab whitespace.
  1095. (?:
  1096. \( # (
  1097. [^\\\x80-\xff\n\015()] * # normal*
  1098. (?: # (
  1099. (?: \\ [^\x80-\xff] |
  1100. \( # (
  1101. [^\\\x80-\xff\n\015()] * # normal*
  1102. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  1103. \) # )
  1104. ) # special
  1105. [^\\\x80-\xff\n\015()] * # normal*
  1106. )* # )*
  1107. \) # )
  1108. [\040\t]* )* # If comment found, allow more spaces.
  1109. (?:
  1110. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  1111. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  1112. |
  1113. \[ # [
  1114. (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
  1115. \] # ]
  1116. )
  1117. [\040\t]* # Nab whitespace.
  1118. (?:
  1119. \( # (
  1120. [^\\\x80-\xff\n\015()] * # normal*
  1121. (?: # (
  1122. (?: \\ [^\x80-\xff] |
  1123. \( # (
  1124. [^\\\x80-\xff\n\015()] * # normal*
  1125. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  1126. \) # )
  1127. ) # special
  1128. [^\\\x80-\xff\n\015()] * # normal*
  1129. )* # )*
  1130. \) # )
  1131. [\040\t]* )* # If comment found, allow more spaces.
  1132. # optional trailing comments
  1133. (?:
  1134. \.
  1135. [\040\t]* # Nab whitespace.
  1136. (?:
  1137. \( # (
  1138. [^\\\x80-\xff\n\015()] * # normal*
  1139. (?: # (
  1140. (?: \\ [^\x80-\xff] |
  1141. \( # (
  1142. [^\\\x80-\xff\n\015()] * # normal*
  1143. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  1144. \) # )
  1145. ) # special
  1146. [^\\\x80-\xff\n\015()] * # normal*
  1147. )* # )*
  1148. \) # )
  1149. [\040\t]* )* # If comment found, allow more spaces.
  1150. (?:
  1151. [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters...
  1152. (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  1153. |
  1154. \[ # [
  1155. (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff
  1156. \] # ]
  1157. )
  1158. [\040\t]* # Nab whitespace.
  1159. (?:
  1160. \( # (
  1161. [^\\\x80-\xff\n\015()] * # normal*
  1162. (?: # (
  1163. (?: \\ [^\x80-\xff] |
  1164. \( # (
  1165. [^\\\x80-\xff\n\015()] * # normal*
  1166. (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)*
  1167. \) # )
  1168. ) # special
  1169. [^\\\x80-\xff\n\015()] * # normal*
  1170. )* # )*
  1171. \) # )
  1172. [\040\t]* )* # If comment found, allow more spaces.
  1173. # optional trailing comments
  1174. )*
  1175. # address spec
  1176. > # >
  1177. # name and address
  1178. )
  1179. /x
  1180. Alan Other <user\@dom.ain>
  1181. <user\@dom.ain>
  1182. user\@dom.ain
  1183. \"A. Other\" <user.1234\@dom.ain> (a comment)
  1184. A. Other <user.1234\@dom.ain> (a comment)
  1185. \"/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/\"\@x400-re.lay
  1186. A missing angle <user\@some.where
  1187. *** Failers
  1188. The quick brown fox
  1189. /abc\0def\00pqr\000xyz\0000AB/
  1190. abc\0def\00pqr\000xyz\0000AB
  1191. abc456 abc\0def\00pqr\000xyz\0000ABCDE
  1192. /abc\x0def\x00pqr\x000xyz\x0000AB/
  1193. abc\x0def\x00pqr\x000xyz\x0000AB
  1194. abc456 abc\x0def\x00pqr\x000xyz\x0000ABCDE
  1195. /^[\000-\037]/
  1196. \0A
  1197. \01B
  1198. \037C
  1199. /\0*/
  1200. \0\0\0\0
  1201. /A\x0{2,3}Z/
  1202. The A\x0\x0Z
  1203. An A\0\x0\0Z
  1204. *** Failers
  1205. A\0Z
  1206. A\0\x0\0\x0Z
  1207. /^(cow|)\1(bell)/
  1208. cowcowbell
  1209. bell
  1210. *** Failers
  1211. cowbell
  1212. /^\s/
  1213. \040abc
  1214. \x0cabc
  1215. \nabc
  1216. \rabc
  1217. \tabc
  1218. *** Failers
  1219. abc
  1220. /^a b
  1221. c/x
  1222. abc
  1223. /^(a|)\1*b/
  1224. ab
  1225. aaaab
  1226. b
  1227. *** Failers
  1228. acb
  1229. /^(a|)\1+b/
  1230. aab
  1231. aaaab
  1232. b
  1233. *** Failers
  1234. ab
  1235. /^(a|)\1?b/
  1236. ab
  1237. aab
  1238. b
  1239. *** Failers
  1240. acb
  1241. /^(a|)\1{2}b/
  1242. aaab
  1243. b
  1244. *** Failers
  1245. ab
  1246. aab
  1247. aaaab
  1248. /^(a|)\1{2,3}b/
  1249. aaab
  1250. aaaab
  1251. b
  1252. *** Failers
  1253. ab
  1254. aab
  1255. aaaaab
  1256. /ab{1,3}bc/
  1257. abbbbc
  1258. abbbc
  1259. abbc
  1260. *** Failers
  1261. abc
  1262. abbbbbc
  1263. /([^.]*)\.([^:]*):[T ]+(.*)/
  1264. track1.title:TBlah blah blah
  1265. /([^.]*)\.([^:]*):[T ]+(.*)/i
  1266. track1.title:TBlah blah blah
  1267. /([^.]*)\.([^:]*):[t ]+(.*)/i
  1268. track1.title:TBlah blah blah
  1269. /^[W-c]+$/
  1270. WXY_^abc
  1271. *** Failers
  1272. wxy
  1273. /^[W-c]+$/i
  1274. WXY_^abc
  1275. wxy_^ABC
  1276. /^[\x3f-\x5F]+$/i
  1277. WXY_^abc
  1278. wxy_^ABC
  1279. /^abc$/m
  1280. abc
  1281. qqq\nabc
  1282. abc\nzzz
  1283. qqq\nabc\nzzz
  1284. /^abc$/
  1285. abc
  1286. *** Failers
  1287. qqq\nabc
  1288. abc\nzzz
  1289. qqq\nabc\nzzz
  1290. /\Aabc\Z/m
  1291. abc
  1292. abc\n
  1293. *** Failers
  1294. qqq\nabc
  1295. abc\nzzz
  1296. qqq\nabc\nzzz
  1297. /\A(.)*\Z/s
  1298. abc\ndef
  1299. /\A(.)*\Z/m
  1300. *** Failers
  1301. abc\ndef
  1302. /(?:b)|(?::+)/
  1303. b::c
  1304. c::b
  1305. /[-az]+/
  1306. az-
  1307. *** Failers
  1308. b
  1309. /[az-]+/
  1310. za-
  1311. *** Failers
  1312. b
  1313. /[a\-z]+/
  1314. a-z
  1315. *** Failers
  1316. b
  1317. /[a-z]+/
  1318. abcdxyz
  1319. /[\d-]+/
  1320. 12-34
  1321. *** Failers
  1322. aaa
  1323. /[\d-z]+/
  1324. 12-34z
  1325. *** Failers
  1326. aaa
  1327. /\x5c/
  1328. \\
  1329. /\x20Z/
  1330. the Zoo
  1331. *** Failers
  1332. Zulu
  1333. /(abc)\1/i
  1334. abcabc
  1335. ABCabc
  1336. abcABC
  1337. /ab{3cd/
  1338. ab{3cd
  1339. /ab{3,cd/
  1340. ab{3,cd
  1341. /ab{3,4a}cd/
  1342. ab{3,4a}cd
  1343. /{4,5a}bc/
  1344. {4,5a}bc
  1345. /abc$/
  1346. abc
  1347. abc\n
  1348. *** Failers
  1349. abc\ndef
  1350. /(abc)\123/
  1351. abc\x53
  1352. /(abc)\223/
  1353. abc\x93
  1354. /(abc)\323/
  1355. abc\xd3
  1356. /(abc)\100/
  1357. abc\x40
  1358. abc\100
  1359. /(abc)\1000/
  1360. abc\x400
  1361. abc\x40\x30
  1362. abc\1000
  1363. abc\100\x30
  1364. abc\100\060
  1365. abc\100\60
  1366. /^A\8B\9C$/
  1367. A8B9C
  1368. *** Failers
  1369. A\08B\09C
  1370. /^(A)(B)(C)(D)(E)(F)(G)(H)(I)\8\9$/
  1371. ABCDEFGHIHI
  1372. /^[A\8B\9C]+$/
  1373. A8B9C
  1374. *** Failers
  1375. A8B9C\x00
  1376. /(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)(l)\12\123/
  1377. abcdefghijkllS
  1378. /(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)\12\123/
  1379. abcdefghijk\12S
  1380. /ab\idef/
  1381. abidef
  1382. /a{0}bc/
  1383. bc
  1384. /(a|(bc)){0,0}?xyz/
  1385. xyz
  1386. /abc[\10]de/
  1387. abc\010de
  1388. /abc[\1]de/
  1389. abc\1de
  1390. /(abc)[\1]de/
  1391. abc\1de
  1392. /(?s)a.b/
  1393. a\nb
  1394. /^([^a])([^\b])([^c]*)([^d]{3,4})/
  1395. baNOTccccd
  1396. baNOTcccd
  1397. baNOTccd
  1398. bacccd
  1399. *** Failers
  1400. anything
  1401. b\bc
  1402. baccd
  1403. /[^a]/
  1404. Abc
  1405. /[^a]/i
  1406. Abc
  1407. /[^a]+/
  1408. AAAaAbc
  1409. /[^a]+/i
  1410. AAAaAbc
  1411. /[^a]+/
  1412. bbb\nccc
  1413. /[^k]$/
  1414. abc
  1415. *** Failers
  1416. abk
  1417. /[^k]{2,3}$/
  1418. abc
  1419. kbc
  1420. kabc
  1421. *** Failers
  1422. abk
  1423. akb
  1424. akk
  1425. /^\d{8,}\@.+[^k]$/
  1426. 12345678\@a.b.c.d
  1427. 123456789\@x.y.z
  1428. *** Failers
  1429. 12345678\@x.y.uk
  1430. 1234567\@a.b.c.d
  1431. /(a)\1{8,}/
  1432. aaaaaaaaa
  1433. aaaaaaaaaa
  1434. *** Failers
  1435. aaaaaaa
  1436. /[^a]/
  1437. aaaabcd
  1438. aaAabcd
  1439. /[^a]/i
  1440. aaaabcd
  1441. aaAabcd
  1442. /[^az]/
  1443. aaaabcd
  1444. aaAabcd
  1445. /[^az]/i
  1446. aaaabcd
  1447. aaAabcd
  1448. /\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/
  1449. \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
  1450. /P[^*]TAIRE[^*]{1,6}?LL/
  1451. xxxxxxxxxxxPSTAIREISLLxxxxxxxxx
  1452. /P[^*]TAIRE[^*]{1,}?LL/
  1453. xxxxxxxxxxxPSTAIREISLLxxxxxxxxx
  1454. /(\.\d\d[1-9]?)\d+/
  1455. 1.230003938
  1456. 1.875000282
  1457. 1.235
  1458. /(\.\d\d((?=0)|\d(?=\d)))/
  1459. 1.230003938
  1460. 1.875000282
  1461. *** Failers
  1462. 1.235
  1463. /a(?)b/
  1464. ab
  1465. /\b(foo)\s+(\w+)/i
  1466. Food is on the foo table
  1467. /foo(.*)bar/
  1468. The food is under the bar in the barn.
  1469. /foo(.*?)bar/
  1470. The food is under the bar in the barn.
  1471. /(.*)(\d*)/
  1472. I have 2 numbers: 53147
  1473. /(.*)(\d+)/
  1474. I have 2 numbers: 53147
  1475. /(.*?)(\d*)/
  1476. I have 2 numbers: 53147
  1477. /(.*?)(\d+)/
  1478. I have 2 numbers: 53147
  1479. /(.*)(\d+)$/
  1480. I have 2 numbers: 53147
  1481. /(.*?)(\d+)$/
  1482. I have 2 numbers: 53147
  1483. /(.*)\b(\d+)$/
  1484. I have 2 numbers: 53147
  1485. /(.*\D)(\d+)$/
  1486. I have 2 numbers: 53147
  1487. /^\D*(?!123)/
  1488. ABC123
  1489. /^(\D*)(?=\d)(?!123)/
  1490. ABC445
  1491. *** Failers
  1492. ABC123
  1493. /^[W-]46]/
  1494. W46]789
  1495. -46]789
  1496. *** Failers
  1497. Wall
  1498. Zebra
  1499. 42
  1500. [abcd]
  1501. ]abcd[
  1502. /^[W-\]46]/
  1503. W46]789
  1504. Wall
  1505. Zebra
  1506. Xylophone
  1507. 42
  1508. [abcd]
  1509. ]abcd[
  1510. \\backslash
  1511. *** Failers
  1512. -46]789
  1513. well
  1514. /\d\d\/\d\d\/\d\d\d\d/
  1515. 01/01/2000
  1516. /word (?:[a-zA-Z0-9]+ ){0,10}otherword/
  1517. word cat dog elephant mussel cow horse canary baboon snake shark otherword
  1518. word cat dog elephant mussel cow horse canary baboon snake shark
  1519. /word (?:[a-zA-Z0-9]+ ){0,300}otherword/
  1520. 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
  1521. /^(a){0,0}/
  1522. bcd
  1523. abc
  1524. aab
  1525. /^(a){0,1}/
  1526. bcd
  1527. abc
  1528. aab
  1529. /^(a){0,2}/
  1530. bcd
  1531. abc
  1532. aab
  1533. /^(a){0,3}/
  1534. bcd
  1535. abc
  1536. aab
  1537. aaa
  1538. /^(a){0,}/
  1539. bcd
  1540. abc
  1541. aab
  1542. aaa
  1543. aaaaaaaa
  1544. /^(a){1,1}/
  1545. bcd
  1546. abc
  1547. aab
  1548. /^(a){1,2}/
  1549. bcd
  1550. abc
  1551. aab
  1552. /^(a){1,3}/
  1553. bcd
  1554. abc
  1555. aab
  1556. aaa
  1557. /^(a){1,}/
  1558. bcd
  1559. abc
  1560. aab
  1561. aaa
  1562. aaaaaaaa
  1563. /.*\.gif/
  1564. borfle\nbib.gif\nno
  1565. /.{0,}\.gif/
  1566. borfle\nbib.gif\nno
  1567. /.*\.gif/m
  1568. borfle\nbib.gif\nno
  1569. /.*\.gif/s
  1570. borfle\nbib.gif\nno
  1571. /.*\.gif/ms
  1572. borfle\nbib.gif\nno
  1573. /.*$/
  1574. borfle\nbib.gif\nno
  1575. /.*$/m
  1576. borfle\nbib.gif\nno
  1577. /.*$/s
  1578. borfle\nbib.gif\nno
  1579. /.*$/ms
  1580. borfle\nbib.gif\nno
  1581. /.*$/
  1582. borfle\nbib.gif\nno\n
  1583. /.*$/m
  1584. borfle\nbib.gif\nno\n
  1585. /.*$/s
  1586. borfle\nbib.gif\nno\n
  1587. /.*$/ms
  1588. borfle\nbib.gif\nno\n
  1589. /(.*X|^B)/
  1590. abcde\n1234Xyz
  1591. BarFoo
  1592. *** Failers
  1593. abcde\nBar
  1594. /(.*X|^B)/m
  1595. abcde\n1234Xyz
  1596. BarFoo
  1597. abcde\nBar
  1598. /(.*X|^B)/s
  1599. abcde\n1234Xyz
  1600. BarFoo
  1601. *** Failers
  1602. abcde\nBar
  1603. /(.*X|^B)/ms
  1604. abcde\n1234Xyz
  1605. BarFoo
  1606. abcde\nBar
  1607. /(?s)(.*X|^B)/
  1608. abcde\n1234Xyz
  1609. BarFoo
  1610. *** Failers
  1611. abcde\nBar
  1612. /(?s:.*X|^B)/
  1613. abcde\n1234Xyz
  1614. BarFoo
  1615. *** Failers
  1616. abcde\nBar
  1617. /^.*B/
  1618. **** Failers
  1619. abc\nB
  1620. /(?s)^.*B/
  1621. abc\nB
  1622. /(?m)^.*B/
  1623. abc\nB
  1624. /(?ms)^.*B/
  1625. abc\nB
  1626. /(?ms)^B/
  1627. abc\nB
  1628. /(?s)B$/
  1629. B\n
  1630. /^[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]/
  1631. 123456654321
  1632. /^\d\d\d\d\d\d\d\d\d\d\d\d/
  1633. 123456654321
  1634. /^[\d][\d][\d][\d][\d][\d][\d][\d][\d][\d][\d][\d]/
  1635. 123456654321
  1636. /^[abc]{12}/
  1637. abcabcabcabc
  1638. /^[a-c]{12}/
  1639. abcabcabcabc
  1640. /^(a|b|c){12}/
  1641. abcabcabcabc
  1642. /^[abcdefghijklmnopqrstuvwxy0123456789]/
  1643. n
  1644. *** Failers
  1645. z
  1646. /abcde{0,0}/
  1647. abcd
  1648. *** Failers
  1649. abce
  1650. /ab[cd]{0,0}e/
  1651. abe
  1652. *** Failers
  1653. abcde
  1654. /ab(c){0,0}d/
  1655. abd
  1656. *** Failers
  1657. abcd
  1658. /a(b*)/
  1659. a
  1660. ab
  1661. abbbb
  1662. *** Failers
  1663. bbbbb
  1664. /ab\d{0}e/
  1665. abe
  1666. *** Failers
  1667. ab1e
  1668. /"([^\\"]+|\\.)*"/
  1669. the \"quick\" brown fox
  1670. \"the \\\"quick\\\" brown fox\"
  1671. /.*?/g+
  1672. abc
  1673. /\b/g+
  1674. abc
  1675. /\b/+g
  1676. abc
  1677. //g
  1678. abc
  1679. /<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
  1680. <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>
  1681. /a[^a]b/
  1682. acb
  1683. a\nb
  1684. /a.b/
  1685. acb
  1686. *** Failers
  1687. a\nb
  1688. /a[^a]b/s
  1689. acb
  1690. a\nb
  1691. /a.b/s
  1692. acb
  1693. a\nb
  1694. /^(b+?|a){1,2}?c/
  1695. bac
  1696. bbac
  1697. bbbac
  1698. bbbbac
  1699. bbbbbac
  1700. /^(b+|a){1,2}?c/
  1701. bac
  1702. bbac
  1703. bbbac
  1704. bbbbac
  1705. bbbbbac
  1706. /(?!\A)x/m
  1707. x\nb\n
  1708. a\bx\n
  1709. /\x0{ab}/
  1710. \0{ab}
  1711. /(A|B)*?CD/
  1712. CD
  1713. /(A|B)*CD/
  1714. CD
  1715. /(AB)*?\1/
  1716. ABABAB
  1717. /(AB)*\1/
  1718. ABABAB
  1719. /(?<!bar)foo/
  1720. foo
  1721. catfood
  1722. arfootle
  1723. rfoosh
  1724. *** Failers
  1725. barfoo
  1726. towbarfoo
  1727. /\w{3}(?<!bar)foo/
  1728. catfood
  1729. *** Failers
  1730. foo
  1731. barfoo
  1732. towbarfoo
  1733. /(?<=(foo)a)bar/
  1734. fooabar
  1735. *** Failers
  1736. bar
  1737. foobbar
  1738. /\Aabc\z/m
  1739. abc
  1740. *** Failers
  1741. abc\n
  1742. qqq\nabc
  1743. abc\nzzz
  1744. qqq\nabc\nzzz
  1745. "(?>.*/)foo"
  1746. /this/is/a/very/long/line/in/deed/with/very/many/slashes/in/it/you/see/
  1747. "(?>.*/)foo"
  1748. /this/is/a/very/long/line/in/deed/with/very/many/slashes/in/and/foo
  1749. /(?>(\.\d\d[1-9]?))\d+/
  1750. 1.230003938
  1751. 1.875000282
  1752. *** Failers
  1753. 1.235
  1754. /^((?>\w+)|(?>\s+))*$/
  1755. now is the time for all good men to come to the aid of the party
  1756. *** Failers
  1757. this is not a line with only words and spaces!
  1758. /(\d+)(\w)/
  1759. 12345a
  1760. 12345+
  1761. /((?>\d+))(\w)/
  1762. 12345a
  1763. *** Failers
  1764. 12345+
  1765. /(?>a+)b/
  1766. aaab
  1767. /((?>a+)b)/
  1768. aaab
  1769. /(?>(a+))b/
  1770. aaab
  1771. /(?>b)+/
  1772. aaabbbccc
  1773. /(?>a+|b+|c+)*c/
  1774. aaabbbbccccd
  1775. /((?>[^()]+)|\([^()]*\))+/
  1776. ((abc(ade)ufh()()x
  1777. /\(((?>[^()]+)|\([^()]+\))+\)/
  1778. (abc)
  1779. (abc(def)xyz)
  1780. *** Failers
  1781. ((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
  1782. /a(?-i)b/i
  1783. ab
  1784. Ab
  1785. *** Failers
  1786. aB
  1787. AB
  1788. /(a (?x)b c)d e/
  1789. a bcd e
  1790. *** Failers
  1791. a b cd e
  1792. abcd e
  1793. a bcde
  1794. /(a b(?x)c d (?-x)e f)/
  1795. a bcde f
  1796. *** Failers
  1797. abcdef
  1798. /(a(?i)b)c/
  1799. abc
  1800. aBc
  1801. *** Failers
  1802. abC
  1803. aBC
  1804. Abc
  1805. ABc
  1806. ABC
  1807. AbC
  1808. /a(?i:b)c/
  1809. abc
  1810. aBc
  1811. *** Failers
  1812. ABC
  1813. abC
  1814. aBC
  1815. /a(?i:b)*c/
  1816. aBc
  1817. aBBc
  1818. *** Failers
  1819. aBC
  1820. aBBC
  1821. /a(?=b(?i)c)\w\wd/
  1822. abcd
  1823. abCd
  1824. *** Failers
  1825. aBCd
  1826. abcD
  1827. /(?s-i:more.*than).*million/i
  1828. more than million
  1829. more than MILLION
  1830. more \n than Million
  1831. *** Failers
  1832. MORE THAN MILLION
  1833. more \n than \n million
  1834. /(?:(?s-i)more.*than).*million/i
  1835. more than million
  1836. more than MILLION
  1837. more \n than Million
  1838. *** Failers
  1839. MORE THAN MILLION
  1840. more \n than \n million
  1841. /(?>a(?i)b+)+c/
  1842. abc
  1843. aBbc
  1844. aBBc
  1845. *** Failers
  1846. Abc
  1847. abAb
  1848. abbC
  1849. /(?=a(?i)b)\w\wc/
  1850. abc
  1851. aBc
  1852. *** Failers
  1853. Ab
  1854. abC
  1855. aBC
  1856. /(?<=a(?i)b)(\w\w)c/
  1857. abxxc
  1858. aBxxc
  1859. *** Failers
  1860. Abxxc
  1861. ABxxc
  1862. abxxC
  1863. /(?:(a)|b)(?(1)A|B)/
  1864. aA
  1865. bB
  1866. *** Failers
  1867. aB
  1868. bA
  1869. /^(a)?(?(1)a|b)+$/
  1870. aa
  1871. b
  1872. bb
  1873. *** Failers
  1874. ab
  1875. /^(?(?=abc)\w{3}:|\d\d)$/
  1876. abc:
  1877. 12
  1878. *** Failers
  1879. 123
  1880. xyz
  1881. /^(?(?!abc)\d\d|\w{3}:)$/
  1882. abc:
  1883. 12
  1884. *** Failers
  1885. 123
  1886. xyz
  1887. /(?(?<=foo)bar|cat)/
  1888. foobar
  1889. cat
  1890. fcat
  1891. focat
  1892. *** Failers
  1893. foocat
  1894. /(?(?<!foo)cat|bar)/
  1895. foobar
  1896. cat
  1897. fcat
  1898. focat
  1899. *** Failers
  1900. foocat
  1901. /( \( )? [^()]+ (?(1) \) |) /x
  1902. abcd
  1903. (abcd)
  1904. the quick (abcd) fox
  1905. (abcd
  1906. /( \( )? [^()]+ (?(1) \) ) /x
  1907. abcd
  1908. (abcd)
  1909. the quick (abcd) fox
  1910. (abcd
  1911. /^(?(2)a|(1)(2))+$/
  1912. 12
  1913. 12a
  1914. 12aa
  1915. *** Failers
  1916. 1234
  1917. /((?i)blah)\s+\1/
  1918. blah blah
  1919. BLAH BLAH
  1920. Blah Blah
  1921. blaH blaH
  1922. *** Failers
  1923. blah BLAH
  1924. Blah blah
  1925. blaH blah
  1926. /((?i)blah)\s+(?i:\1)/
  1927. blah blah
  1928. BLAH BLAH
  1929. Blah Blah
  1930. blaH blaH
  1931. blah BLAH
  1932. Blah blah
  1933. blaH blah
  1934. /(?>a*)*/
  1935. a
  1936. aa
  1937. aaaa
  1938. /(abc|)+/
  1939. abc
  1940. abcabc
  1941. abcabcabc
  1942. xyz
  1943. /([a]*)*/
  1944. a
  1945. aaaaa
  1946. /([ab]*)*/
  1947. a
  1948. b
  1949. ababab
  1950. aaaabcde
  1951. bbbb
  1952. /([^a]*)*/
  1953. b
  1954. bbbb
  1955. aaa
  1956. /([^ab]*)*/
  1957. cccc
  1958. abab
  1959. /([a]*?)*/
  1960. a
  1961. aaaa
  1962. /([ab]*?)*/
  1963. a
  1964. b
  1965. abab
  1966. baba
  1967. /([^a]*?)*/
  1968. b
  1969. bbbb
  1970. aaa
  1971. /([^ab]*?)*/
  1972. c
  1973. cccc
  1974. baba
  1975. /(?>a*)*/
  1976. a
  1977. aaabcde
  1978. /((?>a*))*/
  1979. aaaaa
  1980. aabbaa
  1981. /((?>a*?))*/
  1982. aaaaa
  1983. aabbaa
  1984. /(?(?=[^a-z]+[a-z]) \d{2}-[a-z]{3}-\d{2} | \d{2}-\d{2}-\d{2} ) /x
  1985. 12-sep-98
  1986. 12-09-98
  1987. *** Failers
  1988. sep-12-98
  1989. /(?<=(foo))bar\1/
  1990. foobarfoo
  1991. foobarfootling
  1992. *** Failers
  1993. foobar
  1994. barfoo
  1995. /(?i:saturday|sunday)/
  1996. saturday
  1997. sunday
  1998. Saturday
  1999. Sunday
  2000. SATURDAY
  2001. SUNDAY
  2002. SunDay
  2003. /(a(?i)bc|BB)x/
  2004. abcx
  2005. aBCx
  2006. bbx
  2007. BBx
  2008. *** Failers
  2009. abcX
  2010. aBCX
  2011. bbX
  2012. BBX
  2013. /^([ab](?i)[cd]|[ef])/
  2014. ac
  2015. aC
  2016. bD
  2017. elephant
  2018. Europe
  2019. frog
  2020. France
  2021. *** Failers
  2022. Africa
  2023. /^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)/
  2024. ab
  2025. aBd
  2026. xy
  2027. xY
  2028. zebra
  2029. Zambesi
  2030. *** Failers
  2031. aCD
  2032. XY
  2033. /(?<=foo\n)^bar/m
  2034. foo\nbar
  2035. *** Failers
  2036. bar
  2037. baz\nbar
  2038. /(?<=(?<!foo)bar)baz/
  2039. barbaz
  2040. barbarbaz
  2041. koobarbaz
  2042. *** Failers
  2043. baz
  2044. foobarbaz
  2045. /The cases of aaaa and aaaaaa are missed out below because Perl does things/
  2046. /differently. We know that odd, and maybe incorrect, things happen with/
  2047. /recursive references in Perl, as far as 5.11.3 - see some stuff in test #2./
  2048. /^(a\1?){4}$/
  2049. a
  2050. aa
  2051. aaa
  2052. aaaaa
  2053. aaaaaaa
  2054. aaaaaaaa
  2055. aaaaaaaaa
  2056. aaaaaaaaaa
  2057. aaaaaaaaaaa
  2058. aaaaaaaaaaaa
  2059. aaaaaaaaaaaaa
  2060. aaaaaaaaaaaaaa
  2061. aaaaaaaaaaaaaaa
  2062. aaaaaaaaaaaaaaaa
  2063. /^(a\1?)(a\1?)(a\2?)(a\3?)$/
  2064. a
  2065. aa
  2066. aaa
  2067. aaaa
  2068. aaaaa
  2069. aaaaaa
  2070. aaaaaaa
  2071. aaaaaaaa
  2072. aaaaaaaaa
  2073. aaaaaaaaaa
  2074. aaaaaaaaaaa
  2075. aaaaaaaaaaaa
  2076. aaaaaaaaaaaaa
  2077. aaaaaaaaaaaaaa
  2078. aaaaaaaaaaaaaaa
  2079. aaaaaaaaaaaaaaaa
  2080. /The following tests are taken from the Perl 5.005 test suite; some of them/
  2081. /are compatible with 5.004, but I'd rather not have to sort them out./
  2082. /abc/
  2083. abc
  2084. xabcy
  2085. ababc
  2086. *** Failers
  2087. xbc
  2088. axc
  2089. abx
  2090. /ab*c/
  2091. abc
  2092. /ab*bc/
  2093. abc
  2094. abbc
  2095. abbbbc
  2096. /.{1}/
  2097. abbbbc
  2098. /.{3,4}/
  2099. abbbbc
  2100. /ab{0,}bc/
  2101. abbbbc
  2102. /ab+bc/
  2103. abbc
  2104. *** Failers
  2105. abc
  2106. abq
  2107. /ab{1,}bc/
  2108. /ab+bc/
  2109. abbbbc
  2110. /ab{1,}bc/
  2111. abbbbc
  2112. /ab{1,3}bc/
  2113. abbbbc
  2114. /ab{3,4}bc/
  2115. abbbbc
  2116. /ab{4,5}bc/
  2117. *** Failers
  2118. abq
  2119. abbbbc
  2120. /ab?bc/
  2121. abbc
  2122. abc
  2123. /ab{0,1}bc/
  2124. abc
  2125. /ab?bc/
  2126. /ab?c/
  2127. abc
  2128. /ab{0,1}c/
  2129. abc
  2130. /^abc$/
  2131. abc
  2132. *** Failers
  2133. abbbbc
  2134. abcc
  2135. /^abc/
  2136. abcc
  2137. /^abc$/
  2138. /abc$/
  2139. aabc
  2140. *** Failers
  2141. aabc
  2142. aabcd
  2143. /^/
  2144. abc
  2145. /$/
  2146. abc
  2147. /a.c/
  2148. abc
  2149. axc
  2150. /a.*c/
  2151. axyzc
  2152. /a[bc]d/
  2153. abd
  2154. *** Failers
  2155. axyzd
  2156. abc
  2157. /a[b-d]e/
  2158. ace
  2159. /a[b-d]/
  2160. aac
  2161. /a[-b]/
  2162. a-
  2163. /a[b-]/
  2164. a-
  2165. /a]/
  2166. a]
  2167. /a[]]b/
  2168. a]b
  2169. /a[^bc]d/
  2170. aed
  2171. *** Failers
  2172. abd
  2173. abd
  2174. /a[^-b]c/
  2175. adc
  2176. /a[^]b]c/
  2177. adc
  2178. *** Failers
  2179. a-c
  2180. a]c
  2181. /\ba\b/
  2182. a-
  2183. -a
  2184. -a-
  2185. /\by\b/
  2186. *** Failers
  2187. xy
  2188. yz
  2189. xyz
  2190. /\Ba\B/
  2191. *** Failers
  2192. a-
  2193. -a
  2194. -a-
  2195. /\By\b/
  2196. xy
  2197. /\by\B/
  2198. yz
  2199. /\By\B/
  2200. xyz
  2201. /\w/
  2202. a
  2203. /\W/
  2204. -
  2205. *** Failers
  2206. -
  2207. a
  2208. /a\sb/
  2209. a b
  2210. /a\Sb/
  2211. a-b
  2212. *** Failers
  2213. a-b
  2214. a b
  2215. /\d/
  2216. 1
  2217. /\D/
  2218. -
  2219. *** Failers
  2220. -
  2221. 1
  2222. /[\w]/
  2223. a
  2224. /[\W]/
  2225. -
  2226. *** Failers
  2227. -
  2228. a
  2229. /a[\s]b/
  2230. a b
  2231. /a[\S]b/
  2232. a-b
  2233. *** Failers
  2234. a-b
  2235. a b
  2236. /[\d]/
  2237. 1
  2238. /[\D]/
  2239. -
  2240. *** Failers
  2241. -
  2242. 1
  2243. /ab|cd/
  2244. abc
  2245. abcd
  2246. /()ef/
  2247. def
  2248. /$b/
  2249. /a\(b/
  2250. a(b
  2251. /a\(*b/
  2252. ab
  2253. a((b
  2254. /a\\b/
  2255. a\b
  2256. /((a))/
  2257. abc
  2258. /(a)b(c)/
  2259. abc
  2260. /a+b+c/
  2261. aabbabc
  2262. /a{1,}b{1,}c/
  2263. aabbabc
  2264. /a.+?c/
  2265. abcabc
  2266. /(a+|b)*/
  2267. ab
  2268. /(a+|b){0,}/
  2269. ab
  2270. /(a+|b)+/
  2271. ab
  2272. /(a+|b){1,}/
  2273. ab
  2274. /(a+|b)?/
  2275. ab
  2276. /(a+|b){0,1}/
  2277. ab
  2278. /[^ab]*/
  2279. cde
  2280. /abc/
  2281. *** Failers
  2282. b
  2283. /a*/
  2284. /([abc])*d/
  2285. abbbcd
  2286. /([abc])*bcd/
  2287. abcd
  2288. /a|b|c|d|e/
  2289. e
  2290. /(a|b|c|d|e)f/
  2291. ef
  2292. /abcd*efg/
  2293. abcdefg
  2294. /ab*/
  2295. xabyabbbz
  2296. xayabbbz
  2297. /(ab|cd)e/
  2298. abcde
  2299. /[abhgefdc]ij/
  2300. hij
  2301. /^(ab|cd)e/
  2302. /(abc|)ef/
  2303. abcdef
  2304. /(a|b)c*d/
  2305. abcd
  2306. /(ab|ab*)bc/
  2307. abc
  2308. /a([bc]*)c*/
  2309. abc
  2310. /a([bc]*)(c*d)/
  2311. abcd
  2312. /a([bc]+)(c*d)/
  2313. abcd
  2314. /a([bc]*)(c+d)/
  2315. abcd
  2316. /a[bcd]*dcdcde/
  2317. adcdcde
  2318. /a[bcd]+dcdcde/
  2319. *** Failers
  2320. abcde
  2321. adcdcde
  2322. /(ab|a)b*c/
  2323. abc
  2324. /((a)(b)c)(d)/
  2325. abcd
  2326. /[a-zA-Z_][a-zA-Z0-9_]*/
  2327. alpha
  2328. /^a(bc+|b[eh])g|.h$/
  2329. abh
  2330. /(bc+d$|ef*g.|h?i(j|k))/
  2331. effgz
  2332. ij
  2333. reffgz
  2334. *** Failers
  2335. effg
  2336. bcdd
  2337. /((((((((((a))))))))))/
  2338. a
  2339. /((((((((((a))))))))))\10/
  2340. aa
  2341. /(((((((((a)))))))))/
  2342. a
  2343. /multiple words of text/
  2344. *** Failers
  2345. aa
  2346. uh-uh
  2347. /multiple words/
  2348. multiple words, yeah
  2349. /(.*)c(.*)/
  2350. abcde
  2351. /\((.*), (.*)\)/
  2352. (a, b)
  2353. /[k]/
  2354. /abcd/
  2355. abcd
  2356. /a(bc)d/
  2357. abcd
  2358. /a[-]?c/
  2359. ac
  2360. /(abc)\1/
  2361. abcabc
  2362. /([a-c]*)\1/
  2363. abcabc
  2364. /(a)|\1/
  2365. a
  2366. *** Failers
  2367. ab
  2368. x
  2369. /(([a-c])b*?\2)*/
  2370. ababbbcbc
  2371. /(([a-c])b*?\2){3}/
  2372. ababbbcbc
  2373. /((\3|b)\2(a)x)+/
  2374. aaaxabaxbaaxbbax
  2375. /((\3|b)\2(a)){2,}/
  2376. bbaababbabaaaaabbaaaabba
  2377. /abc/i
  2378. ABC
  2379. XABCY
  2380. ABABC
  2381. *** Failers
  2382. aaxabxbaxbbx
  2383. XBC
  2384. AXC
  2385. ABX
  2386. /ab*c/i
  2387. ABC
  2388. /ab*bc/i
  2389. ABC
  2390. ABBC
  2391. /ab*?bc/i
  2392. ABBBBC
  2393. /ab{0,}?bc/i
  2394. ABBBBC
  2395. /ab+?bc/i
  2396. ABBC
  2397. /ab+bc/i
  2398. *** Failers
  2399. ABC
  2400. ABQ
  2401. /ab{1,}bc/i
  2402. /ab+bc/i
  2403. ABBBBC
  2404. /ab{1,}?bc/i
  2405. ABBBBC
  2406. /ab{1,3}?bc/i
  2407. ABBBBC
  2408. /ab{3,4}?bc/i
  2409. ABBBBC
  2410. /ab{4,5}?bc/i
  2411. *** Failers
  2412. ABQ
  2413. ABBBBC
  2414. /ab??bc/i
  2415. ABBC
  2416. ABC
  2417. /ab{0,1}?bc/i
  2418. ABC
  2419. /ab??bc/i
  2420. /ab??c/i
  2421. ABC
  2422. /ab{0,1}?c/i
  2423. ABC
  2424. /^abc$/i
  2425. ABC
  2426. *** Failers
  2427. ABBBBC
  2428. ABCC
  2429. /^abc/i
  2430. ABCC
  2431. /^abc$/i
  2432. /abc$/i
  2433. AABC
  2434. /^/i
  2435. ABC
  2436. /$/i
  2437. ABC
  2438. /a.c/i
  2439. ABC
  2440. AXC
  2441. /a.*?c/i
  2442. AXYZC
  2443. /a.*c/i
  2444. *** Failers
  2445. AABC
  2446. AXYZD
  2447. /a[bc]d/i
  2448. ABD
  2449. /a[b-d]e/i
  2450. ACE
  2451. *** Failers
  2452. ABC
  2453. ABD
  2454. /a[b-d]/i
  2455. AAC
  2456. /a[-b]/i
  2457. A-
  2458. /a[b-]/i
  2459. A-
  2460. /a]/i
  2461. A]
  2462. /a[]]b/i
  2463. A]B
  2464. /a[^bc]d/i
  2465. AED
  2466. /a[^-b]c/i
  2467. ADC
  2468. *** Failers
  2469. ABD
  2470. A-C
  2471. /a[^]b]c/i
  2472. ADC
  2473. /ab|cd/i
  2474. ABC
  2475. ABCD
  2476. /()ef/i
  2477. DEF
  2478. /$b/i
  2479. *** Failers
  2480. A]C
  2481. B
  2482. /a\(b/i
  2483. A(B
  2484. /a\(*b/i
  2485. AB
  2486. A((B
  2487. /a\\b/i
  2488. A\B
  2489. /((a))/i
  2490. ABC
  2491. /(a)b(c)/i
  2492. ABC
  2493. /a+b+c/i
  2494. AABBABC
  2495. /a{1,}b{1,}c/i
  2496. AABBABC
  2497. /a.+?c/i
  2498. ABCABC
  2499. /a.*?c/i
  2500. ABCABC
  2501. /a.{0,5}?c/i
  2502. ABCABC
  2503. /(a+|b)*/i
  2504. AB
  2505. /(a+|b){0,}/i
  2506. AB
  2507. /(a+|b)+/i
  2508. AB
  2509. /(a+|b){1,}/i
  2510. AB
  2511. /(a+|b)?/i
  2512. AB
  2513. /(a+|b){0,1}/i
  2514. AB
  2515. /(a+|b){0,1}?/i
  2516. AB
  2517. /[^ab]*/i
  2518. CDE
  2519. /abc/i
  2520. /a*/i
  2521. /([abc])*d/i
  2522. ABBBCD
  2523. /([abc])*bcd/i
  2524. ABCD
  2525. /a|b|c|d|e/i
  2526. E
  2527. /(a|b|c|d|e)f/i
  2528. EF
  2529. /abcd*efg/i
  2530. ABCDEFG
  2531. /ab*/i
  2532. XABYABBBZ
  2533. XAYABBBZ
  2534. /(ab|cd)e/i
  2535. ABCDE
  2536. /[abhgefdc]ij/i
  2537. HIJ
  2538. /^(ab|cd)e/i
  2539. ABCDE
  2540. /(abc|)ef/i
  2541. ABCDEF
  2542. /(a|b)c*d/i
  2543. ABCD
  2544. /(ab|ab*)bc/i
  2545. ABC
  2546. /a([bc]*)c*/i
  2547. ABC
  2548. /a([bc]*)(c*d)/i
  2549. ABCD
  2550. /a([bc]+)(c*d)/i
  2551. ABCD
  2552. /a([bc]*)(c+d)/i
  2553. ABCD
  2554. /a[bcd]*dcdcde/i
  2555. ADCDCDE
  2556. /a[bcd]+dcdcde/i
  2557. /(ab|a)b*c/i
  2558. ABC
  2559. /((a)(b)c)(d)/i
  2560. ABCD
  2561. /[a-zA-Z_][a-zA-Z0-9_]*/i
  2562. ALPHA
  2563. /^a(bc+|b[eh])g|.h$/i
  2564. ABH
  2565. /(bc+d$|ef*g.|h?i(j|k))/i
  2566. EFFGZ
  2567. IJ
  2568. REFFGZ
  2569. *** Failers
  2570. ADCDCDE
  2571. EFFG
  2572. BCDD
  2573. /((((((((((a))))))))))/i
  2574. A
  2575. /((((((((((a))))))))))\10/i
  2576. AA
  2577. /(((((((((a)))))))))/i
  2578. A
  2579. /(?:(?:(?:(?:(?:(?:(?:(?:(?:(a))))))))))/i
  2580. A
  2581. /(?:(?:(?:(?:(?:(?:(?:(?:(?:(a|b|c))))))))))/i
  2582. C
  2583. /multiple words of text/i
  2584. *** Failers
  2585. AA
  2586. UH-UH
  2587. /multiple words/i
  2588. MULTIPLE WORDS, YEAH
  2589. /(.*)c(.*)/i
  2590. ABCDE
  2591. /\((.*), (.*)\)/i
  2592. (A, B)
  2593. /[k]/i
  2594. /abcd/i
  2595. ABCD
  2596. /a(bc)d/i
  2597. ABCD
  2598. /a[-]?c/i
  2599. AC
  2600. /(abc)\1/i
  2601. ABCABC
  2602. /([a-c]*)\1/i
  2603. ABCABC
  2604. /a(?!b)./
  2605. abad
  2606. /a(?=d)./
  2607. abad
  2608. /a(?=c|d)./
  2609. abad
  2610. /a(?:b|c|d)(.)/
  2611. ace
  2612. /a(?:b|c|d)*(.)/
  2613. ace
  2614. /a(?:b|c|d)+?(.)/
  2615. ace
  2616. acdbcdbe
  2617. /a(?:b|c|d)+(.)/
  2618. acdbcdbe
  2619. /a(?:b|c|d){2}(.)/
  2620. acdbcdbe
  2621. /a(?:b|c|d){4,5}(.)/
  2622. acdbcdbe
  2623. /a(?:b|c|d){4,5}?(.)/
  2624. acdbcdbe
  2625. /((foo)|(bar))*/
  2626. foobar
  2627. /a(?:b|c|d){6,7}(.)/
  2628. acdbcdbe
  2629. /a(?:b|c|d){6,7}?(.)/
  2630. acdbcdbe
  2631. /a(?:b|c|d){5,6}(.)/
  2632. acdbcdbe
  2633. /a(?:b|c|d){5,6}?(.)/
  2634. acdbcdbe
  2635. /a(?:b|c|d){5,7}(.)/
  2636. acdbcdbe
  2637. /a(?:b|c|d){5,7}?(.)/
  2638. acdbcdbe
  2639. /a(?:b|(c|e){1,2}?|d)+?(.)/
  2640. ace
  2641. /^(.+)?B/
  2642. AB
  2643. /^([^a-z])|(\^)$/
  2644. .
  2645. /^[<>]&/
  2646. <&OUT
  2647. /^(a\1?){4}$/
  2648. aaaaaaaaaa
  2649. *** Failers
  2650. AB
  2651. aaaaaaaaa
  2652. aaaaaaaaaaa
  2653. /^(a(?(1)\1)){4}$/
  2654. aaaaaaaaaa
  2655. *** Failers
  2656. aaaaaaaaa
  2657. aaaaaaaaaaa
  2658. /(?:(f)(o)(o)|(b)(a)(r))*/
  2659. foobar
  2660. /(?<=a)b/
  2661. ab
  2662. *** Failers
  2663. cb
  2664. b
  2665. /(?<!c)b/
  2666. ab
  2667. b
  2668. b
  2669. /(?:..)*a/
  2670. aba
  2671. /(?:..)*?a/
  2672. aba
  2673. /^(?:b|a(?=(.)))*\1/
  2674. abc
  2675. /^(){3,5}/
  2676. abc
  2677. /^(a+)*ax/
  2678. aax
  2679. /^((a|b)+)*ax/
  2680. aax
  2681. /^((a|bc)+)*ax/
  2682. aax
  2683. /(a|x)*ab/
  2684. cab
  2685. /(a)*ab/
  2686. cab
  2687. /(?:(?i)a)b/
  2688. ab
  2689. /((?i)a)b/
  2690. ab
  2691. /(?:(?i)a)b/
  2692. Ab
  2693. /((?i)a)b/
  2694. Ab
  2695. /(?:(?i)a)b/
  2696. *** Failers
  2697. cb
  2698. aB
  2699. /((?i)a)b/
  2700. /(?i:a)b/
  2701. ab
  2702. /((?i:a))b/
  2703. ab
  2704. /(?i:a)b/
  2705. Ab
  2706. /((?i:a))b/
  2707. Ab
  2708. /(?i:a)b/
  2709. *** Failers
  2710. aB
  2711. aB
  2712. /((?i:a))b/
  2713. /(?:(?-i)a)b/i
  2714. ab
  2715. /((?-i)a)b/i
  2716. ab
  2717. /(?:(?-i)a)b/i
  2718. aB
  2719. /((?-i)a)b/i
  2720. aB
  2721. /(?:(?-i)a)b/i
  2722. *** Failers
  2723. aB
  2724. Ab
  2725. /((?-i)a)b/i
  2726. /(?:(?-i)a)b/i
  2727. aB
  2728. /((?-i)a)b/i
  2729. aB
  2730. /(?:(?-i)a)b/i
  2731. *** Failers
  2732. Ab
  2733. AB
  2734. /((?-i)a)b/i
  2735. /(?-i:a)b/i
  2736. ab
  2737. /((?-i:a))b/i
  2738. ab
  2739. /(?-i:a)b/i
  2740. aB
  2741. /((?-i:a))b/i
  2742. aB
  2743. /(?-i:a)b/i
  2744. *** Failers
  2745. AB
  2746. Ab
  2747. /((?-i:a))b/i
  2748. /(?-i:a)b/i
  2749. aB
  2750. /((?-i:a))b/i
  2751. aB
  2752. /(?-i:a)b/i
  2753. *** Failers
  2754. Ab
  2755. AB
  2756. /((?-i:a))b/i
  2757. /((?-i:a.))b/i
  2758. *** Failers
  2759. AB
  2760. a\nB
  2761. /((?s-i:a.))b/i
  2762. a\nB
  2763. /(?:c|d)(?:)(?:a(?:)(?:b)(?:b(?:))(?:b(?:)(?:b)))/
  2764. cabbbb
  2765. /(?:c|d)(?:)(?:aaaaaaaa(?:)(?:bbbbbbbb)(?:bbbbbbbb(?:))(?:bbbbbbbb(?:)(?:bbbbbbbb)))/
  2766. caaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
  2767. /(ab)\d\1/i
  2768. Ab4ab
  2769. ab4Ab
  2770. /foo\w*\d{4}baz/
  2771. foobar1234baz
  2772. /x(~~)*(?:(?:F)?)?/
  2773. x~~
  2774. /^a(?#xxx){3}c/
  2775. aaac
  2776. /^a (?#xxx) (?#yyy) {3}c/x
  2777. aaac
  2778. /(?<![cd])b/
  2779. *** Failers
  2780. B\nB
  2781. dbcb
  2782. /(?<![cd])[ab]/
  2783. dbaacb
  2784. /(?<!(c|d))b/
  2785. /(?<!(c|d))[ab]/
  2786. dbaacb
  2787. /(?<!cd)[ab]/
  2788. cdaccb
  2789. /^(?:a?b?)*$/
  2790. \
  2791. a
  2792. ab
  2793. aaa
  2794. *** Failers
  2795. dbcb
  2796. a--
  2797. aa--
  2798. /((?s)^a(.))((?m)^b$)/
  2799. a\nb\nc\n
  2800. /((?m)^b$)/
  2801. a\nb\nc\n
  2802. /(?m)^b/
  2803. a\nb\n
  2804. /(?m)^(b)/
  2805. a\nb\n
  2806. /((?m)^b)/
  2807. a\nb\n
  2808. /\n((?m)^b)/
  2809. a\nb\n
  2810. /((?s).)c(?!.)/
  2811. a\nb\nc\n
  2812. a\nb\nc\n
  2813. /((?s)b.)c(?!.)/
  2814. a\nb\nc\n
  2815. a\nb\nc\n
  2816. /^b/
  2817. /()^b/
  2818. *** Failers
  2819. a\nb\nc\n
  2820. a\nb\nc\n
  2821. /((?m)^b)/
  2822. a\nb\nc\n
  2823. /(x)?(?(1)a|b)/
  2824. *** Failers
  2825. a
  2826. a
  2827. /(x)?(?(1)b|a)/
  2828. a
  2829. /()?(?(1)b|a)/
  2830. a
  2831. /()(?(1)b|a)/
  2832. /()?(?(1)a|b)/
  2833. a
  2834. /^(\()?blah(?(1)(\)))$/
  2835. (blah)
  2836. blah
  2837. *** Failers
  2838. a
  2839. blah)
  2840. (blah
  2841. /^(\(+)?blah(?(1)(\)))$/
  2842. (blah)
  2843. blah
  2844. *** Failers
  2845. blah)
  2846. (blah
  2847. /(?(?!a)a|b)/
  2848. /(?(?!a)b|a)/
  2849. a
  2850. /(?(?=a)b|a)/
  2851. *** Failers
  2852. a
  2853. a
  2854. /(?(?=a)a|b)/
  2855. a
  2856. /(?=(a+?))(\1ab)/
  2857. aaab
  2858. /^(?=(a+?))\1ab/
  2859. /(\w+:)+/
  2860. one:
  2861. /$(?<=^(a))/
  2862. a
  2863. /(?=(a+?))(\1ab)/
  2864. aaab
  2865. /^(?=(a+?))\1ab/
  2866. *** Failers
  2867. aaab
  2868. aaab
  2869. /([\w:]+::)?(\w+)$/
  2870. abcd
  2871. xy:z:::abcd
  2872. /^[^bcd]*(c+)/
  2873. aexycd
  2874. /(a*)b+/
  2875. caab
  2876. /([\w:]+::)?(\w+)$/
  2877. abcd
  2878. xy:z:::abcd
  2879. *** Failers
  2880. abcd:
  2881. abcd:
  2882. /^[^bcd]*(c+)/
  2883. aexycd
  2884. /(>a+)ab/
  2885. /(?>a+)b/
  2886. aaab
  2887. /([[:]+)/
  2888. a:[b]:
  2889. /([[=]+)/
  2890. a=[b]=
  2891. /([[.]+)/
  2892. a.[b].
  2893. /((?>a+)b)/
  2894. aaab
  2895. /(?>(a+))b/
  2896. aaab
  2897. /((?>[^()]+)|\([^()]*\))+/
  2898. ((abc(ade)ufh()()x
  2899. /a\Z/
  2900. *** Failers
  2901. aaab
  2902. a\nb\n
  2903. /b\Z/
  2904. a\nb\n
  2905. /b\z/
  2906. /b\Z/
  2907. a\nb
  2908. /b\z/
  2909. a\nb
  2910. *** Failers
  2911. /^(?>(?(1)\.|())[^\W_](?>[a-z0-9-]*[^\W_])?)+$/
  2912. a
  2913. abc
  2914. a-b
  2915. 0-9
  2916. a.b
  2917. 5.6.7
  2918. the.quick.brown.fox
  2919. a100.b200.300c
  2920. 12-ab.1245
  2921. *** Failers
  2922. \
  2923. .a
  2924. -a
  2925. a-
  2926. a.
  2927. a_b
  2928. a.-
  2929. a..
  2930. ab..bc
  2931. the.quick.brown.fox-
  2932. the.quick.brown.fox.
  2933. the.quick.brown.fox_
  2934. the.quick.brown.fox+
  2935. /(?>.*)(?<=(abcd|wxyz))/
  2936. alphabetabcd
  2937. endingwxyz
  2938. *** Failers
  2939. a rather long string that doesn't end with one of them
  2940. /word (?>(?:(?!otherword)[a-zA-Z0-9]+ ){0,30})otherword/
  2941. word cat dog elephant mussel cow horse canary baboon snake shark otherword
  2942. word cat dog elephant mussel cow horse canary baboon snake shark
  2943. /word (?>[a-zA-Z0-9]+ ){0,30}otherword/
  2944. 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
  2945. /(?<=\d{3}(?!999))foo/
  2946. 999foo
  2947. 123999foo
  2948. *** Failers
  2949. 123abcfoo
  2950. /(?<=(?!...999)\d{3})foo/
  2951. 999foo
  2952. 123999foo
  2953. *** Failers
  2954. 123abcfoo
  2955. /(?<=\d{3}(?!999)...)foo/
  2956. 123abcfoo
  2957. 123456foo
  2958. *** Failers
  2959. 123999foo
  2960. /(?<=\d{3}...)(?<!999)foo/
  2961. 123abcfoo
  2962. 123456foo
  2963. *** Failers
  2964. 123999foo
  2965. /<a[\s]+href[\s]*=[\s]* # find <a href=
  2966. ([\"\'])? # find single or double quote
  2967. (?(1) (.*?)\1 | ([^\s]+)) # if quote found, match up to next matching
  2968. # quote, otherwise match up to next space
  2969. /isx
  2970. <a href=abcd xyz
  2971. <a href=\"abcd xyz pqr\" cats
  2972. <a href=\'abcd xyz pqr\' cats
  2973. /<a\s+href\s*=\s* # find <a href=
  2974. (["'])? # find single or double quote
  2975. (?(1) (.*?)\1 | (\S+)) # if quote found, match up to next matching
  2976. # quote, otherwise match up to next space
  2977. /isx
  2978. <a href=abcd xyz
  2979. <a href=\"abcd xyz pqr\" cats
  2980. <a href = \'abcd xyz pqr\' cats
  2981. /<a\s+href(?>\s*)=(?>\s*) # find <a href=
  2982. (["'])? # find single or double quote
  2983. (?(1) (.*?)\1 | (\S+)) # if quote found, match up to next matching
  2984. # quote, otherwise match up to next space
  2985. /isx
  2986. <a href=abcd xyz
  2987. <a href=\"abcd xyz pqr\" cats
  2988. <a href = \'abcd xyz pqr\' cats
  2989. /((Z)+|A)*/
  2990. ZABCDEFG
  2991. /(Z()|A)*/
  2992. ZABCDEFG
  2993. /(Z(())|A)*/
  2994. ZABCDEFG
  2995. /((?>Z)+|A)*/
  2996. ZABCDEFG
  2997. /((?>)+|A)*/
  2998. ZABCDEFG
  2999. /a*/g
  3000. abbab
  3001. /^[\d-a]/
  3002. abcde
  3003. -things
  3004. 0digit
  3005. *** Failers
  3006. bcdef
  3007. /[[:space:]]+/
  3008. > \x09\x0a\x0c\x0d\x0b<
  3009. /[[:blank:]]+/
  3010. > \x09\x0a\x0c\x0d\x0b<
  3011. /[\s]+/
  3012. > \x09\x0a\x0c\x0d\x0b<
  3013. /\s+/
  3014. > \x09\x0a\x0c\x0d\x0b<
  3015. /a b/x
  3016. ab
  3017. /(?!\A)x/m
  3018. a\nxb\n
  3019. /(?!^)x/m
  3020. a\nxb\n
  3021. /abc\Qabc\Eabc/
  3022. abcabcabc
  3023. /abc\Q(*+|\Eabc/
  3024. abc(*+|abc
  3025. / abc\Q abc\Eabc/x
  3026. abc abcabc
  3027. *** Failers
  3028. abcabcabc
  3029. /abc#comment
  3030. \Q#not comment
  3031. literal\E/x
  3032. abc#not comment\n literal
  3033. /abc#comment
  3034. \Q#not comment
  3035. literal/x
  3036. abc#not comment\n literal
  3037. /abc#comment
  3038. \Q#not comment
  3039. literal\E #more comment
  3040. /x
  3041. abc#not comment\n literal
  3042. /abc#comment
  3043. \Q#not comment
  3044. literal\E #more comment/x
  3045. abc#not comment\n literal
  3046. /\Qabc\$xyz\E/
  3047. abc\\\$xyz
  3048. /\Qabc\E\$\Qxyz\E/
  3049. abc\$xyz
  3050. /\Gabc/
  3051. abc
  3052. *** Failers
  3053. xyzabc
  3054. /\Gabc./g
  3055. abc1abc2xyzabc3
  3056. /abc./g
  3057. abc1abc2xyzabc3
  3058. /a(?x: b c )d/
  3059. XabcdY
  3060. *** Failers
  3061. Xa b c d Y
  3062. /((?x)x y z | a b c)/
  3063. XabcY
  3064. AxyzB
  3065. /(?i)AB(?-i)C/
  3066. XabCY
  3067. *** Failers
  3068. XabcY
  3069. /((?i)AB(?-i)C|D)E/
  3070. abCE
  3071. DE
  3072. *** Failers
  3073. abcE
  3074. abCe
  3075. dE
  3076. De
  3077. /(.*)\d+\1/
  3078. abc123abc
  3079. abc123bc
  3080. /(.*)\d+\1/s
  3081. abc123abc
  3082. abc123bc
  3083. /((.*))\d+\1/
  3084. abc123abc
  3085. abc123bc
  3086. /-- This tests for an IPv6 address in the form where it can have up to
  3087. eight components, one and only one of which is empty. This must be
  3088. an internal component. --/
  3089. /^(?!:) # colon disallowed at start
  3090. (?: # start of item
  3091. (?: [0-9a-f]{1,4} | # 1-4 hex digits or
  3092. (?(1)0 | () ) ) # if null previously matched, fail; else null
  3093. : # followed by colon
  3094. ){1,7} # end item; 1-7 of them required
  3095. [0-9a-f]{1,4} $ # final hex number at end of string
  3096. (?(1)|.) # check that there was an empty component
  3097. /xi
  3098. a123::a123
  3099. a123:b342::abcd
  3100. a123:b342::324e:abcd
  3101. a123:ddde:b342::324e:abcd
  3102. a123:ddde:b342::324e:dcba:abcd
  3103. a123:ddde:9999:b342::324e:dcba:abcd
  3104. *** Failers
  3105. 1:2:3:4:5:6:7:8
  3106. a123:bce:ddde:9999:b342::324e:dcba:abcd
  3107. a123::9999:b342::324e:dcba:abcd
  3108. abcde:2:3:4:5:6:7:8
  3109. ::1
  3110. abcd:fee0:123::
  3111. :1
  3112. 1:
  3113. /[z\Qa-d]\E]/
  3114. z
  3115. a
  3116. -
  3117. d
  3118. ]
  3119. *** Failers
  3120. b
  3121. /[\z\C]/
  3122. z
  3123. C
  3124. /\M/
  3125. M
  3126. /(a+)*b/
  3127. aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
  3128. /(?i)reg(?:ul(?:[aä]|ae)r|ex)/
  3129. REGular
  3130. regulaer
  3131. Regex
  3132. regulär
  3133. /Åæåä[à-ÿÀ-ß]+/
  3134. Åæåäà
  3135. Åæåäÿ
  3136. ÅæåäÀ
  3137. Åæåäß
  3138. /(?<=Z)X./
  3139. \x84XAZXB
  3140. /ab cd (?x) de fg/
  3141. ab cd defg
  3142. /ab cd(?x) de fg/
  3143. ab cddefg
  3144. ** Failers
  3145. abcddefg
  3146. /(?<![^f]oo)(bar)/
  3147. foobarX
  3148. ** Failers
  3149. boobarX
  3150. /(?<![^f])X/
  3151. offX
  3152. ** Failers
  3153. onyX
  3154. /(?<=[^f])X/
  3155. onyX
  3156. ** Failers
  3157. offX
  3158. /^/mg
  3159. a\nb\nc\n
  3160. \
  3161. /(?<=C\n)^/mg
  3162. A\nC\nC\n
  3163. /(?:(?(1)a|b)(X))+/
  3164. bXaX
  3165. /(?:(?(1)\1a|b)(X|Y))+/
  3166. bXXaYYaY
  3167. bXYaXXaX
  3168. /()()()()()()()()()(?:(?(10)\10a|b)(X|Y))+/
  3169. bXXaYYaY
  3170. /[[,abc,]+]/
  3171. abc]
  3172. a,b]
  3173. [a,b,c]
  3174. /(?-x: )/x
  3175. A\x20B
  3176. "(?x)(?-x: \s*#\s*)"
  3177. A # B
  3178. ** Failers
  3179. #
  3180. "(?x-is)(?:(?-ixs) \s*#\s*) include"
  3181. A #include
  3182. ** Failers
  3183. A#include
  3184. A #Include
  3185. /a*b*\w/
  3186. aaabbbb
  3187. aaaa
  3188. a
  3189. /a*b?\w/
  3190. aaabbbb
  3191. aaaa
  3192. a
  3193. /a*b{0,4}\w/
  3194. aaabbbb
  3195. aaaa
  3196. a
  3197. /a*b{0,}\w/
  3198. aaabbbb
  3199. aaaa
  3200. a
  3201. /a*\d*\w/
  3202. 0a
  3203. a
  3204. /a*b *\w/x
  3205. a
  3206. /a*b#comment
  3207. *\w/x
  3208. a
  3209. /a* b *\w/x
  3210. a
  3211. /^\w+=.*(\\\n.*)*/
  3212. abc=xyz\\\npqr
  3213. /(?=(\w+))\1:/
  3214. abcd:
  3215. /^(?=(\w+))\1:/
  3216. abcd:
  3217. /^\Eabc/
  3218. abc
  3219. /^[\Eabc]/
  3220. a
  3221. ** Failers
  3222. E
  3223. /^[a-\Ec]/
  3224. b
  3225. ** Failers
  3226. -
  3227. E
  3228. /^[a\E\E-\Ec]/
  3229. b
  3230. ** Failers
  3231. -
  3232. E
  3233. /^[\E\Qa\E-\Qz\E]+/
  3234. b
  3235. ** Failers
  3236. -
  3237. /^[a\Q]bc\E]/
  3238. a
  3239. ]
  3240. c
  3241. /^[a-\Q\E]/
  3242. a
  3243. -
  3244. /^(a()*)*/
  3245. aaaa
  3246. /^(?:a(?:(?:))*)*/
  3247. aaaa
  3248. /^(a()+)+/
  3249. aaaa
  3250. /^(?:a(?:(?:))+)+/
  3251. aaaa
  3252. /(a){0,3}(?(1)b|(c|))*D/
  3253. abbD
  3254. ccccD
  3255. D
  3256. /(a|)*\d/
  3257. aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
  3258. aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4
  3259. /(?>a|)*\d/
  3260. aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
  3261. aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4
  3262. /(?:a|)*\d/
  3263. aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
  3264. aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4
  3265. /\Z/g
  3266. abc\n
  3267. /^(?s)(?>.*)(?<!\n)/
  3268. abc
  3269. abc\n
  3270. /^(?![^\n]*\n\z)/
  3271. abc
  3272. abc\n
  3273. /\z(?<!\n)/
  3274. abc
  3275. abc\n
  3276. /(.*(.)?)*/
  3277. abcd
  3278. /( (A | (?(1)0|) )* )/x
  3279. abcd
  3280. /( ( (?(1)0|) )* )/x
  3281. abcd
  3282. /( (?(1)0|)* )/x
  3283. abcd
  3284. /[[:abcd:xyz]]/
  3285. a]
  3286. :]
  3287. /[abc[:x\]pqr]/
  3288. a
  3289. [
  3290. :
  3291. ]
  3292. p
  3293. /.*[op][xyz]/
  3294. fooabcfoo
  3295. /(?(?=.*b)b|^)/
  3296. adc
  3297. abc
  3298. /(?(?=^.*b)b|^)/
  3299. adc
  3300. abc
  3301. /(?(?=.*b)b|^)*/
  3302. adc
  3303. abc
  3304. /(?(?=.*b)b|^)+/
  3305. adc
  3306. abc
  3307. /(?(?=b).*b|^d)/
  3308. abc
  3309. /(?(?=.*b).*b|^d)/
  3310. abc
  3311. /^%((?(?=[a])[^%])|b)*%$/
  3312. %ab%
  3313. /(?i)a(?-i)b|c/
  3314. XabX
  3315. XAbX
  3316. CcC
  3317. ** Failers
  3318. XABX
  3319. /[\x00-\xff\s]+/
  3320. \x0a\x0b\x0c\x0d
  3321. /^\c/
  3322. ?
  3323. /(abc)\1/i
  3324. abc
  3325. /(abc)\1/
  3326. abc
  3327. /[^a]*/i
  3328. 12abc
  3329. 12ABC
  3330. /[^a]*+/i
  3331. 12abc
  3332. 12ABC
  3333. /[^a]*?X/i
  3334. ** Failers
  3335. 12abc
  3336. 12ABC
  3337. /[^a]+?X/i
  3338. ** Failers
  3339. 12abc
  3340. 12ABC
  3341. /[^a]?X/i
  3342. 12aXbcX
  3343. 12AXBCX
  3344. BCX
  3345. /[^a]??X/i
  3346. 12aXbcX
  3347. 12AXBCX
  3348. BCX
  3349. /[^a]?+X/i
  3350. 12aXbcX
  3351. 12AXBCX
  3352. BCX
  3353. /[^a]{2,3}/i
  3354. abcdef
  3355. ABCDEF
  3356. /[^a]{2,3}?/i
  3357. abcdef
  3358. ABCDEF
  3359. /[^a]{2,3}+/i
  3360. abcdef
  3361. ABCDEF
  3362. /((a|)+)+Z/
  3363. Z
  3364. /(a)b|(a)c/
  3365. ac
  3366. /(?>(a))b|(a)c/
  3367. ac
  3368. /(?=(a))ab|(a)c/
  3369. ac
  3370. /((?>(a))b|(a)c)/
  3371. ac
  3372. /((?>(a))b|(a)c)++/
  3373. ac
  3374. /(?:(?>(a))b|(a)c)++/
  3375. ac
  3376. /(?=(?>(a))b|(a)c)(..)/
  3377. ac
  3378. /(?>(?>(a))b|(a)c)/
  3379. ac
  3380. /(?:(?>([ab])))+a=/+
  3381. =ba=
  3382. /(?>([ab]))+a=/+
  3383. =ba=
  3384. /((?>(a+)b)+(aabab))/
  3385. aaaabaaabaabab
  3386. /(?>a+|ab)+?c/
  3387. aabc
  3388. /(?>a+|ab)+c/
  3389. aabc
  3390. /(?:a+|ab)+c/
  3391. aabc
  3392. /(?(?=(a))a)/
  3393. a
  3394. /(?(?=(a))a)(b)/
  3395. ab
  3396. /^(?:a|ab)++c/
  3397. aaaabc
  3398. /^(?>a|ab)++c/
  3399. aaaabc
  3400. /^(?:a|ab)+c/
  3401. aaaabc
  3402. /(?=abc){3}abc/+
  3403. abcabcabc
  3404. ** Failers
  3405. xyz
  3406. /(?=abc)+abc/+
  3407. abcabcabc
  3408. ** Failers
  3409. xyz
  3410. /(?=abc)++abc/+
  3411. abcabcabc
  3412. ** Failers
  3413. xyz
  3414. /(?=abc){0}xyz/
  3415. xyz
  3416. /(?=abc){1}xyz/
  3417. ** Failers
  3418. xyz
  3419. /(?=(a))?./
  3420. ab
  3421. bc
  3422. /(?=(a))??./
  3423. ab
  3424. bc
  3425. /^(?=(?1))?[az]([abc])d/
  3426. abd
  3427. zcdxx
  3428. /^(?!a){0}\w+/
  3429. aaaaa
  3430. /(?<=(abc))?xyz/
  3431. abcxyz
  3432. pqrxyz
  3433. /^[\g<a>]+/
  3434. ggg<<<aaa>>>
  3435. ** Failers
  3436. \\ga
  3437. /^[\ga]+/
  3438. gggagagaxyz
  3439. /^[:a[:digit:]]+/
  3440. aaaa444:::Z
  3441. /^[:a[:digit:]:b]+/
  3442. aaaa444:::bbbZ
  3443. /[:a]xxx[b:]/
  3444. :xxx:
  3445. /(?<=a{2})b/i
  3446. xaabc
  3447. ** Failers
  3448. xabc
  3449. /(?<!a{2})b/i
  3450. xabc
  3451. ** Failers
  3452. xaabc
  3453. /(?<=a\h)c/
  3454. xa c
  3455. /(?<=[^a]{2})b/
  3456. axxbc
  3457. aAAbc
  3458. ** Failers
  3459. xaabc
  3460. /(?<=[^a]{2})b/i
  3461. axxbc
  3462. ** Failers
  3463. aAAbc
  3464. xaabc
  3465. /(?<=a\H)c/
  3466. abc
  3467. /(?<=a\V)c/
  3468. abc
  3469. /(?<=a\v)c/
  3470. a\nc
  3471. /(?(?=c)c|d)++Y/
  3472. XcccddYX
  3473. /(?(?=c)c|d)*+Y/
  3474. XcccddYX
  3475. /^(a{2,3}){2,}+a/
  3476. aaaaaaa
  3477. ** Failers
  3478. aaaaaa
  3479. aaaaaaaaa
  3480. /^(a{2,3})++a/
  3481. ** Failers
  3482. aaaaaa
  3483. /^(a{2,3})*+a/
  3484. ** Failers
  3485. aaaaaa
  3486. /ab\Cde/
  3487. abXde
  3488. /(?<=ab\Cde)X/
  3489. abZdeX
  3490. /a[\CD]b/
  3491. aCb
  3492. aDb
  3493. /a[\C-X]b/
  3494. aJb
  3495. /\H\h\V\v/
  3496. X X\x0a
  3497. X\x09X\x0b
  3498. ** Failers
  3499. \xa0 X\x0a
  3500. /\H*\h+\V?\v{3,4}/
  3501. \x09\x20\xa0X\x0a\x0b\x0c\x0d\x0a
  3502. \x09\x20\xa0\x0a\x0b\x0c\x0d\x0a
  3503. \x09\x20\xa0\x0a\x0b\x0c
  3504. ** Failers
  3505. \x09\x20\xa0\x0a\x0b
  3506. /\H{3,4}/
  3507. XY ABCDE
  3508. XY PQR ST
  3509. /.\h{3,4}./
  3510. XY AB PQRS
  3511. /\h*X\h?\H+Y\H?Z/
  3512. >XNNNYZ
  3513. > X NYQZ
  3514. ** Failers
  3515. >XYZ
  3516. > X NY Z
  3517. /\v*X\v?Y\v+Z\V*\x0a\V+\x0b\V{2,3}\x0c/
  3518. >XY\x0aZ\x0aA\x0bNN\x0c
  3519. >\x0a\x0dX\x0aY\x0a\x0bZZZ\x0aAAA\x0bNNN\x0c
  3520. /(foo)\Kbar/
  3521. foobar
  3522. /(foo)(\Kbar|baz)/
  3523. foobar
  3524. foobaz
  3525. /(foo\Kbar)baz/
  3526. foobarbaz
  3527. /abc\K|def\K/g+
  3528. Xabcdefghi
  3529. /ab\Kc|de\Kf/g+
  3530. Xabcdefghi
  3531. /(?=C)/g+
  3532. ABCDECBA
  3533. /^abc\K/+
  3534. abcdef
  3535. ** Failers
  3536. defabcxyz
  3537. /^(a(b))\1\g1\g{1}\g-1\g{-1}\g{-02}Z/
  3538. ababababbbabZXXXX
  3539. /(?<A>tom|bon)-\g{A}/
  3540. tom-tom
  3541. bon-bon
  3542. /(^(a|b\g{-1}))/
  3543. bacxxx
  3544. /(?|(abc)|(xyz))\1/
  3545. abcabc
  3546. xyzxyz
  3547. ** Failers
  3548. abcxyz
  3549. xyzabc
  3550. /(?|(abc)|(xyz))(?1)/
  3551. abcabc
  3552. xyzabc
  3553. ** Failers
  3554. xyzxyz
  3555. /^X(?5)(a)(?|(b)|(q))(c)(d)(Y)/
  3556. XYabcdY
  3557. /^X(?7)(a)(?|(b|(r)(s))|(q))(c)(d)(Y)/
  3558. XYabcdY
  3559. /^X(?7)(a)(?|(b|(?|(r)|(t))(s))|(q))(c)(d)(Y)/
  3560. XYabcdY
  3561. /(?'abc'\w+):\k<abc>{2}/
  3562. a:aaxyz
  3563. ab:ababxyz
  3564. ** Failers
  3565. a:axyz
  3566. ab:abxyz
  3567. /(?'abc'\w+):\g{abc}{2}/
  3568. a:aaxyz
  3569. ab:ababxyz
  3570. ** Failers
  3571. a:axyz
  3572. ab:abxyz
  3573. /^(?<ab>a)? (?(<ab>)b|c) (?('ab')d|e)/x
  3574. abd
  3575. ce
  3576. /^(a.)\g-1Z/
  3577. aXaXZ
  3578. /^(a.)\g{-1}Z/
  3579. aXaXZ
  3580. /^(?(DEFINE) (?<A> a) (?<B> b) ) (?&A) (?&B) /x
  3581. abcd
  3582. /(?<NAME>(?&NAME_PAT))\s+(?<ADDR>(?&ADDRESS_PAT))
  3583. (?(DEFINE)
  3584. (?<NAME_PAT>[a-z]+)
  3585. (?<ADDRESS_PAT>\d+)
  3586. )/x
  3587. metcalfe 33
  3588. /(?(DEFINE)(?<byte>2[0-4]\d|25[0-5]|1\d\d|[1-9]?\d))\b(?&byte)(\.(?&byte)){3}/
  3589. 1.2.3.4
  3590. 131.111.10.206
  3591. 10.0.0.0
  3592. ** Failers
  3593. 10.6
  3594. 455.3.4.5
  3595. /\b(?&byte)(\.(?&byte)){3}(?(DEFINE)(?<byte>2[0-4]\d|25[0-5]|1\d\d|[1-9]?\d))/
  3596. 1.2.3.4
  3597. 131.111.10.206
  3598. 10.0.0.0
  3599. ** Failers
  3600. 10.6
  3601. 455.3.4.5
  3602. /^(\w++|\s++)*$/
  3603. now is the time for all good men to come to the aid of the party
  3604. *** Failers
  3605. this is not a line with only words and spaces!
  3606. /(\d++)(\w)/
  3607. 12345a
  3608. *** Failers
  3609. 12345+
  3610. /a++b/
  3611. aaab
  3612. /(a++b)/
  3613. aaab
  3614. /(a++)b/
  3615. aaab
  3616. /([^()]++|\([^()]*\))+/
  3617. ((abc(ade)ufh()()x
  3618. /\(([^()]++|\([^()]+\))+\)/
  3619. (abc)
  3620. (abc(def)xyz)
  3621. *** Failers
  3622. ((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
  3623. /^([^()]|\((?1)*\))*$/
  3624. abc
  3625. a(b)c
  3626. a(b(c))d
  3627. *** Failers)
  3628. a(b(c)d
  3629. /^>abc>([^()]|\((?1)*\))*<xyz<$/
  3630. >abc>123<xyz<
  3631. >abc>1(2)3<xyz<
  3632. >abc>(1(2)3)<xyz<
  3633. /^(?:((.)(?1)\2|)|((.)(?3)\4|.))$/i
  3634. 1221
  3635. Satanoscillatemymetallicsonatas
  3636. AmanaplanacanalPanama
  3637. AblewasIereIsawElba
  3638. *** Failers
  3639. Thequickbrownfox
  3640. /^(\d+|\((?1)([+*-])(?1)\)|-(?1))$/
  3641. 12
  3642. (((2+2)*-3)-7)
  3643. -12
  3644. *** Failers
  3645. ((2+2)*-3)-7)
  3646. /^(x(y|(?1){2})z)/
  3647. xyz
  3648. xxyzxyzz
  3649. *** Failers
  3650. xxyzz
  3651. xxyzxyzxyzz
  3652. /((< (?: (?(R) \d++ | [^<>]*+) | (?2)) * >))/x
  3653. <>
  3654. <abcd>
  3655. <abc <123> hij>
  3656. <abc <def> hij>
  3657. <abc<>def>
  3658. <abc<>
  3659. *** Failers
  3660. <abc
  3661. /^a+(*FAIL)/
  3662. aaaaaa
  3663. /a+b?c+(*FAIL)/
  3664. aaabccc
  3665. /a+b?(*PRUNE)c+(*FAIL)/
  3666. aaabccc
  3667. /a+b?(*COMMIT)c+(*FAIL)/
  3668. aaabccc
  3669. /a+b?(*SKIP)c+(*FAIL)/
  3670. aaabcccaaabccc
  3671. /^(?:aaa(*THEN)\w{6}|bbb(*THEN)\w{5}|ccc(*THEN)\w{4}|\w{3})/
  3672. aaaxxxxxx
  3673. aaa++++++
  3674. bbbxxxxx
  3675. bbb+++++
  3676. cccxxxx
  3677. ccc++++
  3678. dddddddd
  3679. /^(aaa(*THEN)\w{6}|bbb(*THEN)\w{5}|ccc(*THEN)\w{4}|\w{3})/
  3680. aaaxxxxxx
  3681. aaa++++++
  3682. bbbxxxxx
  3683. bbb+++++
  3684. cccxxxx
  3685. ccc++++
  3686. dddddddd
  3687. /a+b?(*THEN)c+(*FAIL)/
  3688. aaabccc
  3689. /(A (A|B(*ACCEPT)|C) D)(E)/x
  3690. AB
  3691. ABX
  3692. AADE
  3693. ACDE
  3694. ** Failers
  3695. AD
  3696. /^\W*+(?:((.)\W*+(?1)\W*+\2|)|((.)\W*+(?3)\W*+\4|\W*+.\W*+))\W*+$/i
  3697. 1221
  3698. Satan, oscillate my metallic sonatas!
  3699. A man, a plan, a canal: Panama!
  3700. Able was I ere I saw Elba.
  3701. *** Failers
  3702. The quick brown fox
  3703. /^((.)(?1)\2|.)$/
  3704. a
  3705. aba
  3706. aabaa
  3707. abcdcba
  3708. pqaabaaqp
  3709. ablewasiereisawelba
  3710. rhubarb
  3711. the quick brown fox
  3712. /(a)(?<=b(?1))/
  3713. baz
  3714. ** Failers
  3715. caz
  3716. /(?<=b(?1))(a)/
  3717. zbaaz
  3718. ** Failers
  3719. aaa
  3720. /(?<X>a)(?<=b(?&X))/
  3721. baz
  3722. /^(?|(abc)|(def))\1/
  3723. abcabc
  3724. defdef
  3725. ** Failers
  3726. abcdef
  3727. defabc
  3728. /^(?|(abc)|(def))(?1)/
  3729. abcabc
  3730. defabc
  3731. ** Failers
  3732. defdef
  3733. abcdef
  3734. /(?:a(?<quote> (?<apostrophe>')|(?<realquote>")) |b(?<quote> (?<apostrophe>')|(?<realquote>")) ) (?('quote')[a-z]+|[0-9]+)/xJ
  3735. a\"aaaaa
  3736. b\"aaaaa
  3737. ** Failers
  3738. b\"11111
  3739. /(?:(?1)|B)(A(*F)|C)/
  3740. ABCD
  3741. CCD
  3742. ** Failers
  3743. CAD
  3744. /^(?:(?1)|B)(A(*F)|C)/
  3745. CCD
  3746. BCD
  3747. ** Failers
  3748. ABCD
  3749. CAD
  3750. BAD
  3751. /(?:(?1)|B)(A(*ACCEPT)XX|C)D/
  3752. AAD
  3753. ACD
  3754. BAD
  3755. BCD
  3756. BAX
  3757. ** Failers
  3758. ACX
  3759. ABC
  3760. /(?(DEFINE)(A))B(?1)C/
  3761. BAC
  3762. /(?(DEFINE)((A)\2))B(?1)C/
  3763. BAAC
  3764. /(?<pn> \( ( [^()]++ | (?&pn) )* \) )/x
  3765. (ab(cd)ef)
  3766. /^(?=a(*SKIP)b|ac)/
  3767. ** Failers
  3768. ac
  3769. /^(?=a(*PRUNE)b)/
  3770. ab
  3771. ** Failers
  3772. ac
  3773. /^(?=a(*ACCEPT)b)/
  3774. ac
  3775. /(?>a\Kb)/
  3776. ab
  3777. /((?>a\Kb))/
  3778. ab
  3779. /(a\Kb)/
  3780. ab
  3781. /^a\Kcz|ac/
  3782. ac
  3783. /(?>a\Kbz|ab)/
  3784. ab
  3785. /^(?&t)(?(DEFINE)(?<t>a\Kb))$/
  3786. ab
  3787. /^([^()]|\((?1)*\))*$/
  3788. a(b)c
  3789. a(b(c)d)e
  3790. /(?P<L1>(?P<L2>0)(?P>L1)|(?P>L2))/
  3791. 0
  3792. 00
  3793. 0000
  3794. /(?P<L1>(?P<L2>0)|(?P>L2)(?P>L1))/
  3795. 0
  3796. 00
  3797. 0000
  3798. /--- This one does fail, as expected, in Perl. It needs the complex item at the
  3799. end of the pattern. A single letter instead of (B|D) makes it not fail,
  3800. which I think is a Perl bug. --- /
  3801. /A(*COMMIT)(B|D)/
  3802. ACABX
  3803. /--- Check the use of names for failure ---/
  3804. /^(A(*PRUNE:A)B|C(*PRUNE:B)D)/K
  3805. ** Failers
  3806. AC
  3807. CB
  3808. /--- Force no study, otherwise mark is not seen. The studied version is in
  3809. test 2 because it isn't Perl-compatible. ---/
  3810. /(*MARK:A)(*SKIP:B)(C|X)/KSS
  3811. C
  3812. D
  3813. /^(A(*THEN:A)B|C(*THEN:B)D)/K
  3814. ** Failers
  3815. CB
  3816. /^(?:A(*THEN:A)B|C(*THEN:B)D)/K
  3817. CB
  3818. /^(?>A(*THEN:A)B|C(*THEN:B)D)/K
  3819. CB
  3820. /--- This should succeed, as the skip causes bump to offset 1 (the mark). Note
  3821. that we have to have something complicated such as (B|Z) at the end because,
  3822. for Perl, a simple character somehow causes an unwanted optimization to mess
  3823. with the handling of backtracking verbs. ---/
  3824. /A(*MARK:A)A+(*SKIP:A)(B|Z) | AC/xK
  3825. AAAC
  3826. /--- Test skipping over a non-matching mark. ---/
  3827. /A(*MARK:A)A+(*MARK:B)(*SKIP:A)(B|Z) | AC/xK
  3828. AAAC
  3829. /--- Check shorthand for MARK ---/
  3830. /A(*:A)A+(*SKIP:A)(B|Z) | AC/xK
  3831. AAAC
  3832. /--- Don't loop! Force no study, otherwise mark is not seen. ---/
  3833. /(*:A)A+(*SKIP:A)(B|Z)/KSS
  3834. AAAC
  3835. /--- This should succeed, as a non-existent skip name disables the skip ---/
  3836. /A(*MARK:A)A+(*SKIP:B)(B|Z) | AC/xK
  3837. AAAC
  3838. /A(*MARK:A)A+(*SKIP:B)(B|Z) | AC(*:B)/xK
  3839. AAAC
  3840. /--- COMMIT at the start of a pattern should act like an anchor. Again,
  3841. however, we need the complication for Perl. ---/
  3842. /(*COMMIT)(A|P)(B|P)(C|P)/
  3843. ABCDEFG
  3844. ** Failers
  3845. DEFGABC
  3846. /--- COMMIT inside an atomic group can't stop backtracking over the group. ---/
  3847. /(\w+)(?>b(*COMMIT))\w{2}/
  3848. abbb
  3849. /(\w+)b(*COMMIT)\w{2}/
  3850. abbb
  3851. /--- Check opening parens in comment when seeking forward reference. ---/
  3852. /(?&t)(?#()(?(DEFINE)(?<t>a))/
  3853. bac
  3854. /--- COMMIT should override THEN ---/
  3855. /(?>(*COMMIT)(?>yes|no)(*THEN)(*F))?/
  3856. yes
  3857. /(?>(*COMMIT)(yes|no)(*THEN)(*F))?/
  3858. yes
  3859. /b?(*SKIP)c/
  3860. bc
  3861. abc
  3862. /(*SKIP)bc/
  3863. a
  3864. /(*SKIP)b/
  3865. a
  3866. /(?P<abn>(?P=abn)xxx|)+/
  3867. xxx
  3868. /(?i:([^b]))(?1)/
  3869. aa
  3870. aA
  3871. ** Failers
  3872. ab
  3873. aB
  3874. Ba
  3875. ba
  3876. /^(?&t)*+(?(DEFINE)(?<t>a))\w$/
  3877. aaaaaaX
  3878. ** Failers
  3879. aaaaaa
  3880. /^(?&t)*(?(DEFINE)(?<t>a))\w$/
  3881. aaaaaaX
  3882. aaaaaa
  3883. /^(a)*+(\w)/
  3884. aaaaX
  3885. YZ
  3886. ** Failers
  3887. aaaa
  3888. /^(?:a)*+(\w)/
  3889. aaaaX
  3890. YZ
  3891. ** Failers
  3892. aaaa
  3893. /^(a)++(\w)/
  3894. aaaaX
  3895. ** Failers
  3896. aaaa
  3897. YZ
  3898. /^(?:a)++(\w)/
  3899. aaaaX
  3900. ** Failers
  3901. aaaa
  3902. YZ
  3903. /^(a)?+(\w)/
  3904. aaaaX
  3905. YZ
  3906. /^(?:a)?+(\w)/
  3907. aaaaX
  3908. YZ
  3909. /^(a){2,}+(\w)/
  3910. aaaaX
  3911. ** Failers
  3912. aaa
  3913. YZ
  3914. /^(?:a){2,}+(\w)/
  3915. aaaaX
  3916. ** Failers
  3917. aaa
  3918. YZ
  3919. /(a|)*(?1)b/
  3920. b
  3921. ab
  3922. aab
  3923. /(a)++(?1)b/
  3924. ** Failers
  3925. ab
  3926. aab
  3927. /(a)*+(?1)b/
  3928. ** Failers
  3929. ab
  3930. aab
  3931. /(?1)(?:(b)){0}/
  3932. b
  3933. /(foo ( \( ((?:(?> [^()]+ )|(?2))*) \) ) )/x
  3934. foo(bar(baz)+baz(bop))
  3935. /(A (A|B(*ACCEPT)|C) D)(E)/x
  3936. AB
  3937. /\A.*?(a|bc)/
  3938. ba
  3939. /\A.*?(?:a|bc)++/
  3940. ba
  3941. /\A.*?(a|bc)++/
  3942. ba
  3943. /\A.*?(?:a|bc|d)/
  3944. ba
  3945. /(?:(b))++/
  3946. beetle
  3947. /(?(?=(a(*ACCEPT)z))a)/
  3948. a
  3949. /^(a)(?1)+ab/
  3950. aaaab
  3951. /^(a)(?1)++ab/
  3952. aaaab
  3953. /^(?=a(*:M))aZ/K
  3954. aZbc
  3955. /^(?!(*:M)b)aZ/K
  3956. aZbc
  3957. /(?(DEFINE)(a))?b(?1)/
  3958. backgammon
  3959. /^\N+/
  3960. abc\ndef
  3961. /^\N{1,}/
  3962. abc\ndef
  3963. /(?(R)a+|(?R)b)/
  3964. aaaabcde
  3965. /(?(R)a+|((?R))b)/
  3966. aaaabcde
  3967. /((?(R)a+|(?1)b))/
  3968. aaaabcde
  3969. /((?(R1)a+|(?1)b))/
  3970. aaaabcde
  3971. /((?(R)a|(?1)))*/
  3972. aaa
  3973. /((?(R)a|(?1)))+/
  3974. aaa
  3975. /a(*:any
  3976. name)/K
  3977. abc
  3978. /(?>(?&t)c|(?&t))(?(DEFINE)(?<t>a|b(*PRUNE)c))/
  3979. a
  3980. ba
  3981. bba
  3982. /--- Checking revised (*THEN) handling ---/
  3983. /--- Capture ---/
  3984. /^.*? (a(*THEN)b) c/x
  3985. aabc
  3986. /^.*? (a(*THEN)b|(*F)) c/x
  3987. aabc
  3988. /^.*? ( (a(*THEN)b) | (*F) ) c/x
  3989. aabc
  3990. /^.*? ( (a(*THEN)b) ) c/x
  3991. aabc
  3992. /--- Non-capture ---/
  3993. /^.*? (?:a(*THEN)b) c/x
  3994. aabc
  3995. /^.*? (?:a(*THEN)b|(*F)) c/x
  3996. aabc
  3997. /^.*? (?: (?:a(*THEN)b) | (*F) ) c/x
  3998. aabc
  3999. /^.*? (?: (?:a(*THEN)b) ) c/x
  4000. aabc
  4001. /--- Atomic ---/
  4002. /^.*? (?>a(*THEN)b) c/x
  4003. aabc
  4004. /^.*? (?>a(*THEN)b|(*F)) c/x
  4005. aabc
  4006. /^.*? (?> (?>a(*THEN)b) | (*F) ) c/x
  4007. aabc
  4008. /^.*? (?> (?>a(*THEN)b) ) c/x
  4009. aabc
  4010. /--- Possessive capture ---/
  4011. /^.*? (a(*THEN)b)++ c/x
  4012. aabc
  4013. /^.*? (a(*THEN)b|(*F))++ c/x
  4014. aabc
  4015. /^.*? ( (a(*THEN)b)++ | (*F) )++ c/x
  4016. aabc
  4017. /^.*? ( (a(*THEN)b)++ )++ c/x
  4018. aabc
  4019. /--- Possessive non-capture ---/
  4020. /^.*? (?:a(*THEN)b)++ c/x
  4021. aabc
  4022. /^.*? (?:a(*THEN)b|(*F))++ c/x
  4023. aabc
  4024. /^.*? (?: (?:a(*THEN)b)++ | (*F) )++ c/x
  4025. aabc
  4026. /^.*? (?: (?:a(*THEN)b)++ )++ c/x
  4027. aabc
  4028. /--- Condition assertion ---/
  4029. /^(?(?=a(*THEN)b)ab|ac)/
  4030. ac
  4031. /--- Condition ---/
  4032. /^.*?(?(?=a)a|b(*THEN)c)/
  4033. ba
  4034. /^.*?(?:(?(?=a)a|b(*THEN)c)|d)/
  4035. ba
  4036. /^.*?(?(?=a)a(*THEN)b|c)/
  4037. ac
  4038. /--- Assertion ---/
  4039. /^.*(?=a(*THEN)b)/
  4040. aabc
  4041. /------------------------------/
  4042. /(?>a(*:m))/imsxSK
  4043. a
  4044. /(?>(a)(*:m))/imsxSK
  4045. a
  4046. /(?<=a(*ACCEPT)b)c/
  4047. xacd
  4048. /(?<=(a(*ACCEPT)b))c/
  4049. xacd
  4050. /(?<=(a(*COMMIT)b))c/
  4051. xabcd
  4052. ** Failers
  4053. xacd
  4054. /(?<!a(*FAIL)b)c/
  4055. xcd
  4056. acd
  4057. /(?<=a(*:N)b)c/K
  4058. xabcd
  4059. /(?<=a(*PRUNE)b)c/
  4060. xabcd
  4061. /(?<=a(*SKIP)b)c/
  4062. xabcd
  4063. /(?<=a(*THEN)b)c/
  4064. xabcd
  4065. /(a)(?2){2}(.)/
  4066. abcd
  4067. /(*MARK:A)(*PRUNE:B)(C|X)/KS
  4068. C
  4069. D
  4070. /(*MARK:A)(*PRUNE:B)(C|X)/KSS
  4071. C
  4072. D
  4073. /(*MARK:A)(*THEN:B)(C|X)/KS
  4074. C
  4075. D
  4076. /(*MARK:A)(*THEN:B)(C|X)/KSY
  4077. C
  4078. D
  4079. /(*MARK:A)(*THEN:B)(C|X)/KSS
  4080. C
  4081. D
  4082. /--- This should fail, as the skip causes a bump to offset 3 (the skip) ---/
  4083. /A(*MARK:A)A+(*SKIP)(B|Z) | AC/xK
  4084. AAAC
  4085. /--- Same --/
  4086. /A(*MARK:A)A+(*MARK:B)(*SKIP:B)(B|Z) | AC/xK
  4087. AAAC
  4088. /A(*:A)A+(*SKIP)(B|Z) | AC/xK
  4089. AAAC
  4090. /--- This should fail, as a null name is the same as no name ---/
  4091. /A(*MARK:A)A+(*SKIP:)(B|Z) | AC/xK
  4092. AAAC
  4093. /--- A check on what happens after hitting a mark and them bumping along to
  4094. something that does not even start. Perl reports tags after the failures here,
  4095. though it does not when the individual letters are made into something
  4096. more complicated. ---/
  4097. /A(*:A)B|XX(*:B)Y/K
  4098. AABC
  4099. XXYZ
  4100. ** Failers
  4101. XAQQ
  4102. XAQQXZZ
  4103. AXQQQ
  4104. AXXQQQ
  4105. /^(A(*THEN:A)B|C(*THEN:B)D)/K
  4106. AB
  4107. CD
  4108. ** Failers
  4109. AC
  4110. CB
  4111. /^(A(*PRUNE:A)B|C(*PRUNE:B)D)/K
  4112. AB
  4113. CD
  4114. ** Failers
  4115. AC
  4116. CB
  4117. /--- An empty name does not pass back an empty string. It is the same as if no
  4118. name were given. ---/
  4119. /^(A(*PRUNE:)B|C(*PRUNE:B)D)/K
  4120. AB
  4121. CD
  4122. /--- PRUNE goes to next bumpalong; COMMIT does not. ---/
  4123. /A(*PRUNE:A)B/K
  4124. ACAB
  4125. /--- Mark names can be duplicated ---/
  4126. /A(*:A)B|X(*:A)Y/K
  4127. AABC
  4128. XXYZ
  4129. /b(*:m)f|a(*:n)w/K
  4130. aw
  4131. ** Failers
  4132. abc
  4133. /b(*:m)f|aw/K
  4134. abaw
  4135. ** Failers
  4136. abc
  4137. abax
  4138. /A(*MARK:A)A+(*SKIP:B)(B|Z) | AAC/xK
  4139. AAAC
  4140. /a(*PRUNE:X)bc|qq/KY
  4141. ** Failers
  4142. axy
  4143. /a(*THEN:X)bc|qq/KY
  4144. ** Failers
  4145. axy
  4146. /(?=a(*MARK:A)b)..x/K
  4147. abxy
  4148. ** Failers
  4149. abpq
  4150. /(?=a(*MARK:A)b)..(*:Y)x/K
  4151. abxy
  4152. ** Failers
  4153. abpq
  4154. /(?=a(*PRUNE:A)b)..x/K
  4155. abxy
  4156. ** Failers
  4157. abpq
  4158. /(?=a(*PRUNE:A)b)..(*:Y)x/K
  4159. abxy
  4160. ** Failers
  4161. abpq
  4162. /(?=a(*THEN:A)b)..x/K
  4163. abxy
  4164. ** Failers
  4165. abpq
  4166. /(?=a(*THEN:A)b)..(*:Y)x/K
  4167. abxy
  4168. ** Failers
  4169. abpq
  4170. /(another)?(\1?)test/
  4171. hello world test
  4172. /(another)?(\1+)test/
  4173. hello world test
  4174. /(a(*COMMIT)b){0}a(?1)|aac/
  4175. aac
  4176. /((?:a?)*)*c/
  4177. aac
  4178. /((?>a?)*)*c/
  4179. aac
  4180. /(?>.*?a)(?<=ba)/
  4181. aba
  4182. /(?:.*?a)(?<=ba)/
  4183. aba
  4184. /.*?a(*PRUNE)b/
  4185. aab
  4186. /.*?a(*PRUNE)b/s
  4187. aab
  4188. /^a(*PRUNE)b/s
  4189. aab
  4190. /.*?a(*SKIP)b/
  4191. aab
  4192. /(?>.*?a)b/s
  4193. aab
  4194. /(?>.*?a)b/
  4195. aab
  4196. /(?>^a)b/s
  4197. aab
  4198. /(?>.*?)(?<=(abcd)|(wxyz))/
  4199. alphabetabcd
  4200. endingwxyz
  4201. /(?>.*)(?<=(abcd)|(wxyz))/
  4202. alphabetabcd
  4203. endingwxyz
  4204. "(?>.*)foo"
  4205. abcdfooxyz
  4206. "(?>.*?)foo"
  4207. abcdfooxyz
  4208. /(?:(a(*PRUNE)b)){0}(?:(?1)|ac)/
  4209. ac
  4210. /(?:(a(*SKIP)b)){0}(?:(?1)|ac)/
  4211. ac
  4212. /(?<=(*SKIP)ac)a/
  4213. aa
  4214. /A(*MARK:A)A+(*SKIP:B)(B|Z) | AC/xK
  4215. AAAC
  4216. /a(*SKIP:m)x|ac(*:n)(*SKIP:n)d|ac/K
  4217. acacd
  4218. /A(*SKIP:m)x|A(*SKIP:n)x|AB/K
  4219. AB
  4220. /((*SKIP:r)d){0}a(*SKIP:m)x|ac(*:n)|ac/K
  4221. acacd
  4222. /-- Tests that try to figure out how Perl works. My hypothesis is that the
  4223. first verb that is backtracked onto is the one that acts. This seems to be
  4224. the case almost all the time, but there is one exception that is perhaps a
  4225. bug. --/
  4226. /-- This matches "aaaac"; each PRUNE advances one character until the subject
  4227. no longer starts with 5 'a's. --/
  4228. /aaaaa(*PRUNE)b|a+c/
  4229. aaaaaac
  4230. /-- Putting SKIP in front of PRUNE makes no difference, as it is never
  4231. backtracked onto, whether or not it has a label. --/
  4232. /aaaaa(*SKIP)(*PRUNE)b|a+c/
  4233. aaaaaac
  4234. /aaaaa(*SKIP:N)(*PRUNE)b|a+c/
  4235. aaaaaac
  4236. /aaaa(*:N)a(*SKIP:N)(*PRUNE)b|a+c/
  4237. aaaaaac
  4238. /-- Putting THEN in front makes no difference. */
  4239. /aaaaa(*THEN)(*PRUNE)b|a+c/
  4240. aaaaaac
  4241. /-- However, putting COMMIT in front of the prune changes it to "no match". I
  4242. think this is inconsistent and possibly a bug. For the moment, running this
  4243. test is moved out of the Perl-compatible file. --/
  4244. /aaaaa(*COMMIT)(*PRUNE)b|a+c/
  4245. /---- OK, lets play the same game again using SKIP instead of PRUNE. ----/
  4246. /-- This matches "ac" because SKIP forces the next match to start on the
  4247. sixth "a". --/
  4248. /aaaaa(*SKIP)b|a+c/
  4249. aaaaaac
  4250. /-- Putting PRUNE in front makes no difference. --/
  4251. /aaaaa(*PRUNE)(*SKIP)b|a+c/
  4252. aaaaaac
  4253. /-- Putting THEN in front makes no difference. --/
  4254. /aaaaa(*THEN)(*SKIP)b|a+c/
  4255. aaaaaac
  4256. /-- In this case, neither does COMMIT. This still matches "ac". --/
  4257. /aaaaa(*COMMIT)(*SKIP)b|a+c/
  4258. aaaaaac
  4259. /-- This gives "no match", as expected. --/
  4260. /aaaaa(*COMMIT)b|a+c/
  4261. aaaaaac
  4262. /------ Tests using THEN ------/
  4263. /-- This matches "aaaaaac", as expected. --/
  4264. /aaaaa(*THEN)b|a+c/
  4265. aaaaaac
  4266. /-- Putting SKIP in front makes no difference. --/
  4267. /aaaaa(*SKIP)(*THEN)b|a+c/
  4268. aaaaaac
  4269. /-- Putting PRUNE in front makes no difference. --/
  4270. /aaaaa(*PRUNE)(*THEN)b|a+c/
  4271. aaaaaac
  4272. /-- Putting COMMIT in front makes no difference. --/
  4273. /aaaaa(*COMMIT)(*THEN)b|a+c/
  4274. aaaaaac
  4275. /-- End of "priority" tests --/
  4276. /aaaaa(*:m)(*PRUNE:m)(*SKIP:m)m|a+/
  4277. aaaaaa
  4278. /aaaaa(*:m)(*MARK:m)(*PRUNE)(*SKIP:m)m|a+/
  4279. aaaaaa
  4280. /aaaaa(*:n)(*PRUNE:m)(*SKIP:m)m|a+/
  4281. aaaaaa
  4282. /aaaaa(*:n)(*MARK:m)(*PRUNE)(*SKIP:m)m|a+/
  4283. aaaaaa
  4284. /a(*MARK:A)aa(*PRUNE:A)a(*SKIP:A)b|a+c/
  4285. aaaac
  4286. /a(*MARK:A)aa(*MARK:A)a(*SKIP:A)b|a+c/
  4287. aaaac
  4288. /aaa(*PRUNE:A)a(*SKIP:A)b|a+c/
  4289. aaaac
  4290. /aaa(*MARK:A)a(*SKIP:A)b|a+c/
  4291. aaaac
  4292. /a(*:m)a(*COMMIT)(*SKIP:m)b|a+c/K
  4293. aaaaaac
  4294. /.?(a|b(*THEN)c)/
  4295. ba
  4296. /(a(*COMMIT)b)c|abd/
  4297. abc
  4298. abd
  4299. /(?=a(*COMMIT)b)abc|abd/
  4300. abc
  4301. abd
  4302. /(?>a(*COMMIT)b)c|abd/
  4303. abc
  4304. abd
  4305. /a(?=b(*COMMIT)c)[^d]|abd/
  4306. abd
  4307. abc
  4308. /a(?=bc).|abd/
  4309. abd
  4310. abc
  4311. /a(?>b(*COMMIT)c)d|abd/
  4312. abceabd
  4313. /a(?>bc)d|abd/
  4314. abceabd
  4315. /(?>a(*COMMIT)b)c|abd/
  4316. abd
  4317. /(?>a(*COMMIT)c)d|abd/
  4318. abd
  4319. /((?=a(*COMMIT)b)ab|ac){0}(?:(?1)|a(c))/
  4320. ac
  4321. /-- These tests were formerly in test 2, but changes in PCRE and Perl have
  4322. made them compatible. --/
  4323. /^(a)?(?(1)a|b)+$/
  4324. *** Failers
  4325. a
  4326. /(?=a\Kb)ab/
  4327. ab
  4328. /(?!a\Kb)ac/
  4329. ac
  4330. /^abc(?<=b\Kc)d/
  4331. abcd
  4332. /^abc(?<!b\Kq)d/
  4333. abcd
  4334. /A(*PRUNE:A)A+(*SKIP:A)(B|Z) | AC/xK
  4335. AAAC
  4336. /^((abc|abcx)(*THEN)y|abcd)/
  4337. abcd
  4338. *** Failers
  4339. abcxy
  4340. /^((yes|no)(*THEN)(*F))?/
  4341. yes
  4342. /(A (.*) C? (*THEN) | A D) (*FAIL)/x
  4343. AbcdCBefgBhiBqz
  4344. /(A (.*) C? (*THEN) | A D) z/x
  4345. AbcdCBefgBhiBqz
  4346. /(A (.*) C? (*THEN) | A D) \s* (*FAIL)/x
  4347. AbcdCBefgBhiBqz
  4348. /(A (.*) C? (*THEN) | A D) \s* z/x
  4349. AbcdCBefgBhiBqz
  4350. /(A (.*) (?:C|) (*THEN) | A D) (*FAIL)/x
  4351. AbcdCBefgBhiBqz
  4352. /(A (.*) (?:C|) (*THEN) | A D) z/x
  4353. AbcdCBefgBhiBqz
  4354. /(A (.*) C{0,6} (*THEN) | A D) (*FAIL)/x
  4355. AbcdCBefgBhiBqz
  4356. /(A (.*) C{0,6} (*THEN) | A D) z/x
  4357. AbcdCBefgBhiBqz
  4358. /(A (.*) (CE){0,6} (*THEN) | A D) (*FAIL)/x
  4359. AbcdCEBefgBhiBqz
  4360. /(A (.*) (CE){0,6} (*THEN) | A D) z/x
  4361. AbcdCEBefgBhiBqz
  4362. /(A (.*) (CE*){0,6} (*THEN) | A D) (*FAIL)/x
  4363. AbcdCBefgBhiBqz
  4364. /(A (.*) (CE*){0,6} (*THEN) | A D) z/x
  4365. AbcdCBefgBhiBqz
  4366. /(?=a(*COMMIT)b|ac)ac|ac/
  4367. ac
  4368. /(?=a(*COMMIT)b|(ac)) ac | (a)c/x
  4369. ac
  4370. /--------/
  4371. /(?(?!b(*THEN)a)bn|bnn)/
  4372. bnn
  4373. /(?!b(*SKIP)a)bn|bnn/
  4374. bnn
  4375. /(?(?!b(*SKIP)a)bn|bnn)/
  4376. bnn
  4377. /(?!b(*PRUNE)a)bn|bnn/
  4378. bnn
  4379. /(?(?!b(*PRUNE)a)bn|bnn)/
  4380. bnn
  4381. /(?!b(*COMMIT)a)bn|bnn/
  4382. bnn
  4383. /(?(?!b(*COMMIT)a)bn|bnn)/
  4384. bnn
  4385. /(?=b(*SKIP)a)bn|bnn/
  4386. bnn
  4387. /(?=b(*THEN)a)bn|bnn/
  4388. bnn
  4389. /^(?!a(*SKIP)b)/
  4390. ac
  4391. /^(?!a(*SKIP)b)../
  4392. acd
  4393. /(?!a(*SKIP)b)../
  4394. acd
  4395. /^(?(?!a(*SKIP)b))/
  4396. ac
  4397. /^(?!a(*PRUNE)b)../
  4398. acd
  4399. /(?!a(*PRUNE)b)../
  4400. acd
  4401. /(?!a(*COMMIT)b)ac|cd/
  4402. ac
  4403. /\A.*?(?:a|bc)/
  4404. ba
  4405. /^(A(*THEN)B|C(*THEN)D)/
  4406. CD
  4407. /(*:m(m)(?&y)(?(DEFINE)(?<y>b))/K
  4408. abc
  4409. /(*PRUNE:m(m)(?&y)(?(DEFINE)(?<y>b))/K
  4410. abc
  4411. /(*SKIP:m(m)(?&y)(?(DEFINE)(?<y>b))/K
  4412. abc
  4413. /(*THEN:m(m)(?&y)(?(DEFINE)(?<y>b))/K
  4414. abc
  4415. /^\d*\w{4}/
  4416. 1234
  4417. 123
  4418. /^[^b]*\w{4}/
  4419. aaaa
  4420. aaa
  4421. /^[^b]*\w{4}/i
  4422. aaaa
  4423. aaa
  4424. /^a*\w{4}/
  4425. aaaa
  4426. aaa
  4427. /^a*\w{4}/i
  4428. aaaa
  4429. aaa
  4430. /(?(?=ab)ab)/+
  4431. ca
  4432. cd
  4433. /(?:(?<n>foo)|(?<n>bar))\k<n>/J
  4434. foofoo
  4435. barbar
  4436. /(?<n>A)(?:(?<n>foo)|(?<n>bar))\k<n>/J
  4437. AfooA
  4438. AbarA
  4439. ** Failers
  4440. Afoofoo
  4441. Abarbar
  4442. /^(\d+)\s+IN\s+SOA\s+(\S+)\s+(\S+)\s*\(\s*$/
  4443. 1 IN SOA non-sp1 non-sp2(
  4444. /^ (?:(?<A>A)|(?'B'B)(?<A>A)) (?('A')x) (?(<B>)y)$/xJ
  4445. Ax
  4446. BAxy
  4447. /^A\xZ/
  4448. A\0Z
  4449. /^A\o{123}B/
  4450. A\123B
  4451. / ^ a + + b $ /x
  4452. aaaab
  4453. / ^ a + #comment
  4454. + b $ /x
  4455. aaaab
  4456. / ^ a + #comment
  4457. #comment
  4458. + b $ /x
  4459. aaaab
  4460. / ^ (?> a + ) b $ /x
  4461. aaaab
  4462. / ^ ( a + ) + + \w $ /x
  4463. aaaab
  4464. /(?:a\Kb)*+/+
  4465. ababc
  4466. /(?>a\Kb)*/+
  4467. ababc
  4468. /(?:a\Kb)*/+
  4469. ababc
  4470. /(a\Kb)*+/+
  4471. ababc
  4472. /(a\Kb)*/+
  4473. ababc
  4474. /(?:x|(?:(xx|yy)+|x|x|x|x|x)|a|a|a)bc/
  4475. acb
  4476. '\A(?:[^\"]++|\"(?:[^\"]*+|\"\")*+\")++'
  4477. NON QUOTED \"QUOT\"\"ED\" AFTER \"NOT MATCHED
  4478. '\A(?:[^\"]++|\"(?:[^\"]++|\"\")*+\")++'
  4479. NON QUOTED \"QUOT\"\"ED\" AFTER \"NOT MATCHED
  4480. '\A(?:[^\"]++|\"(?:[^\"]++|\"\")++\")++'
  4481. NON QUOTED \"QUOT\"\"ED\" AFTER \"NOT MATCHED
  4482. '\A([^\"1]++|[\"2]([^\"3]*+|[\"4][\"5])*+[\"6])++'
  4483. NON QUOTED \"QUOT\"\"ED\" AFTER \"NOT MATCHED
  4484. /^\w+(?>\s*)(?<=\w)/
  4485. test test
  4486. /(?P<same>a)(?P<same>b)/gJ
  4487. abbaba
  4488. /(?P<same>a)(?P<same>b)(?P=same)/gJ
  4489. abbaba
  4490. /(?P=same)?(?P<same>a)(?P<same>b)/gJ
  4491. abbaba
  4492. /(?:(?P=same)?(?:(?P<same>a)|(?P<same>b))(?P=same))+/gJ
  4493. bbbaaabaabb
  4494. /(?:(?P=same)?(?:(?P=same)(?P<same>a)(?P=same)|(?P=same)?(?P<same>b)(?P=same)){2}(?P=same)(?P<same>c)(?P=same)){2}(?P<same>z)?/gJ
  4495. bbbaaaccccaaabbbcc
  4496. /(?P<Name>a)?(?P<Name2>b)?(?(<Name>)c|d)*l/
  4497. acl
  4498. bdl
  4499. adl
  4500. bcl
  4501. /\sabc/
  4502. \x{0b}abc
  4503. /[\Qa]\E]+/
  4504. aa]]
  4505. /[\Q]a\E]+/
  4506. aa]]
  4507. /(?:((abcd))|(((?:(?:(?:(?:abc|(?:abcdef))))b)abcdefghi)abc)|((*ACCEPT)))/
  4508. 1234abcd
  4509. /(\2)(\1)/
  4510. "Z*(|d*){216}"
  4511. "(?1)(?#?'){8}(a)"
  4512. baaaaaaaaac
  4513. "(?|(\k'Pm')|(?'Pm'))"
  4514. abcd
  4515. /(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?=.*[,;:])(?=.{8,16})(?!.*[\s])/
  4516. \ Fred:099
  4517. /(?=.*X)X$/
  4518. \ X
  4519. /X+(?#comment)?/
  4520. >XXX<
  4521. / (?<word> \w+ )* \. /xi
  4522. pokus.
  4523. /(?(DEFINE) (?<word> \w+ ) ) (?&word)* \./xi
  4524. pokus.
  4525. /(?(DEFINE) (?<word> \w+ ) ) ( (?&word)* ) \./xi
  4526. pokus.
  4527. /(?&word)* (?(DEFINE) (?<word> \w+ ) ) \./xi
  4528. pokus.
  4529. /(?&word)* \. (?<word> \w+ )/xi
  4530. pokus.hokus
  4531. /-- End of testinput1 --/