testoutput2 364 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686
  1. # This set of tests is not Perl-compatible. It checks on special features
  2. # of PCRE2's API, error diagnostics, and the compiled code of some patterns.
  3. # It also checks the non-Perl syntax that PCRE2 supports (Python, .NET,
  4. # Oniguruma). There are also some tests where PCRE2 and Perl differ,
  5. # either because PCRE2 can't be compatible, or there is a possible Perl
  6. # bug.
  7. # NOTE: This is a non-UTF set of tests. When UTF support is needed, use
  8. # test 5.
  9. #forbid_utf
  10. #newline_default lf any anycrlf
  11. # Test binary zeroes in the pattern
  12. # /a\0B/ where 0 is a binary zero
  13. /61 5c 00 62/B,hex
  14. ------------------------------------------------------------------
  15. Bra
  16. a\x00b
  17. Ket
  18. End
  19. ------------------------------------------------------------------
  20. a\x{0}b
  21. 0: a\x00b
  22. # /a0b/ where 0 is a binary zero
  23. /61 00 62/B,hex
  24. ------------------------------------------------------------------
  25. Bra
  26. a\x00b
  27. Ket
  28. End
  29. ------------------------------------------------------------------
  30. a\x{0}b
  31. 0: a\x00b
  32. # /(?#B0C)DE/ where 0 is a binary zero
  33. /28 3f 23 42 00 43 29 44 45/B,hex
  34. ------------------------------------------------------------------
  35. Bra
  36. DE
  37. Ket
  38. End
  39. ------------------------------------------------------------------
  40. DE
  41. 0: DE
  42. /(a)b|/I
  43. Capture group count = 1
  44. May match empty string
  45. Subject length lower bound = 0
  46. /abc/I
  47. Capture group count = 0
  48. First code unit = 'a'
  49. Last code unit = 'c'
  50. Subject length lower bound = 3
  51. abc
  52. 0: abc
  53. defabc
  54. 0: abc
  55. abc\=anchored
  56. 0: abc
  57. \= Expect no match
  58. defabc\=anchored
  59. No match
  60. ABC
  61. No match
  62. /^abc/I
  63. Capture group count = 0
  64. Compile options: <none>
  65. Overall options: anchored
  66. First code unit = 'a'
  67. Subject length lower bound = 3
  68. abc
  69. 0: abc
  70. abc\=anchored
  71. 0: abc
  72. \= Expect no match
  73. defabc
  74. No match
  75. defabc\=anchored
  76. No match
  77. /a+bc/I
  78. Capture group count = 0
  79. First code unit = 'a'
  80. Last code unit = 'c'
  81. Subject length lower bound = 3
  82. /a*bc/I
  83. Capture group count = 0
  84. Starting code units: a b
  85. Last code unit = 'c'
  86. Subject length lower bound = 2
  87. /a{3}bc/I
  88. Capture group count = 0
  89. First code unit = 'a'
  90. Last code unit = 'c'
  91. Subject length lower bound = 5
  92. /(abc|a+z)/I
  93. Capture group count = 1
  94. First code unit = 'a'
  95. Subject length lower bound = 2
  96. /^abc$/I
  97. Capture group count = 0
  98. Compile options: <none>
  99. Overall options: anchored
  100. First code unit = 'a'
  101. Subject length lower bound = 3
  102. abc
  103. 0: abc
  104. \= Expect no match
  105. def\nabc
  106. No match
  107. /ab\idef/
  108. Failed: error 103 at offset 3: unrecognized character follows \
  109. /(?X)ab\idef/
  110. Failed: error 111 at offset 2: unrecognized character after (? or (?-
  111. /x{5,4}/
  112. Failed: error 104 at offset 5: numbers out of order in {} quantifier
  113. /z{65536}/
  114. Failed: error 105 at offset 7: number too big in {} quantifier
  115. /[abcd/
  116. Failed: error 106 at offset 5: missing terminating ] for character class
  117. /[\B]/B
  118. Failed: error 107 at offset 2: escape sequence is invalid in character class
  119. /[\R]/B
  120. Failed: error 107 at offset 2: escape sequence is invalid in character class
  121. /[\X]/B
  122. Failed: error 107 at offset 2: escape sequence is invalid in character class
  123. /[z-a]/
  124. Failed: error 108 at offset 3: range out of order in character class
  125. /^*/
  126. Failed: error 109 at offset 1: quantifier does not follow a repeatable item
  127. /(abc/
  128. Failed: error 114 at offset 4: missing closing parenthesis
  129. /(?# abc/
  130. Failed: error 118 at offset 7: missing ) after (?# comment
  131. /(?z)abc/
  132. Failed: error 111 at offset 2: unrecognized character after (? or (?-
  133. /.*b/I
  134. Capture group count = 0
  135. First code unit at start or follows newline
  136. Last code unit = 'b'
  137. Subject length lower bound = 1
  138. /.*?b/I
  139. Capture group count = 0
  140. First code unit at start or follows newline
  141. Last code unit = 'b'
  142. Subject length lower bound = 1
  143. /cat|dog|elephant/I
  144. Capture group count = 0
  145. Starting code units: c d e
  146. Subject length lower bound = 3
  147. this sentence eventually mentions a cat
  148. 0: cat
  149. this sentences rambles on and on for a while and then reaches elephant
  150. 0: elephant
  151. /cat|dog|elephant/I
  152. Capture group count = 0
  153. Starting code units: c d e
  154. Subject length lower bound = 3
  155. this sentence eventually mentions a cat
  156. 0: cat
  157. this sentences rambles on and on for a while and then reaches elephant
  158. 0: elephant
  159. /cat|dog|elephant/Ii
  160. Capture group count = 0
  161. Options: caseless
  162. Starting code units: C D E c d e
  163. Subject length lower bound = 3
  164. this sentence eventually mentions a CAT cat
  165. 0: CAT
  166. this sentences rambles on and on for a while to elephant ElePhant
  167. 0: elephant
  168. /a|[bcd]/I
  169. Capture group count = 0
  170. Starting code units: a b c d
  171. Subject length lower bound = 1
  172. /(a|[^\dZ])/I
  173. Capture group count = 1
  174. Starting code units: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x09 \x0a
  175. \x0b \x0c \x0d \x0e \x0f \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19
  176. \x1a \x1b \x1c \x1d \x1e \x1f \x20 ! " # $ % & ' ( ) * + , - . / : ; < = >
  177. ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y [ \ ] ^ _ ` a b c d
  178. e f g h i j k l m n o p q r s t u v w x y z { | } ~ \x7f \x80 \x81 \x82 \x83
  179. \x84 \x85 \x86 \x87 \x88 \x89 \x8a \x8b \x8c \x8d \x8e \x8f \x90 \x91 \x92
  180. \x93 \x94 \x95 \x96 \x97 \x98 \x99 \x9a \x9b \x9c \x9d \x9e \x9f \xa0 \xa1
  181. \xa2 \xa3 \xa4 \xa5 \xa6 \xa7 \xa8 \xa9 \xaa \xab \xac \xad \xae \xaf \xb0
  182. \xb1 \xb2 \xb3 \xb4 \xb5 \xb6 \xb7 \xb8 \xb9 \xba \xbb \xbc \xbd \xbe \xbf
  183. \xc0 \xc1 \xc2 \xc3 \xc4 \xc5 \xc6 \xc7 \xc8 \xc9 \xca \xcb \xcc \xcd \xce
  184. \xcf \xd0 \xd1 \xd2 \xd3 \xd4 \xd5 \xd6 \xd7 \xd8 \xd9 \xda \xdb \xdc \xdd
  185. \xde \xdf \xe0 \xe1 \xe2 \xe3 \xe4 \xe5 \xe6 \xe7 \xe8 \xe9 \xea \xeb \xec
  186. \xed \xee \xef \xf0 \xf1 \xf2 \xf3 \xf4 \xf5 \xf6 \xf7 \xf8 \xf9 \xfa \xfb
  187. \xfc \xfd \xfe \xff
  188. Subject length lower bound = 1
  189. /(a|b)*[\s]/I
  190. Capture group count = 1
  191. Starting code units: \x09 \x0a \x0b \x0c \x0d \x20 a b
  192. Subject length lower bound = 1
  193. /(ab\2)/
  194. Failed: error 115 at offset 4: reference to non-existent subpattern
  195. /{4,5}abc/
  196. Failed: error 109 at offset 4: quantifier does not follow a repeatable item
  197. /(a)(b)(c)\2/I
  198. Capture group count = 3
  199. Max back reference = 2
  200. First code unit = 'a'
  201. Last code unit = 'c'
  202. Subject length lower bound = 4
  203. abcb
  204. 0: abcb
  205. 1: a
  206. 2: b
  207. 3: c
  208. abcb\=ovector=0
  209. 0: abcb
  210. 1: a
  211. 2: b
  212. 3: c
  213. abcb\=ovector=1
  214. Matched, but too many substrings
  215. 0: abcb
  216. abcb\=ovector=2
  217. Matched, but too many substrings
  218. 0: abcb
  219. 1: a
  220. abcb\=ovector=3
  221. Matched, but too many substrings
  222. 0: abcb
  223. 1: a
  224. 2: b
  225. abcb\=ovector=4
  226. 0: abcb
  227. 1: a
  228. 2: b
  229. 3: c
  230. /(a)bc|(a)(b)\2/I
  231. Capture group count = 3
  232. Max back reference = 2
  233. First code unit = 'a'
  234. Subject length lower bound = 3
  235. abc
  236. 0: abc
  237. 1: a
  238. abc\=ovector=0
  239. 0: abc
  240. 1: a
  241. abc\=ovector=1
  242. Matched, but too many substrings
  243. 0: abc
  244. abc\=ovector=2
  245. 0: abc
  246. 1: a
  247. aba
  248. 0: aba
  249. 1: <unset>
  250. 2: a
  251. 3: b
  252. aba\=ovector=0
  253. 0: aba
  254. 1: <unset>
  255. 2: a
  256. 3: b
  257. aba\=ovector=1
  258. Matched, but too many substrings
  259. 0: aba
  260. aba\=ovector=2
  261. Matched, but too many substrings
  262. 0: aba
  263. 1: <unset>
  264. aba\=ovector=3
  265. Matched, but too many substrings
  266. 0: aba
  267. 1: <unset>
  268. 2: a
  269. aba\=ovector=4
  270. 0: aba
  271. 1: <unset>
  272. 2: a
  273. 3: b
  274. /abc$/I,dollar_endonly
  275. Capture group count = 0
  276. Options: dollar_endonly
  277. First code unit = 'a'
  278. Last code unit = 'c'
  279. Subject length lower bound = 3
  280. abc
  281. 0: abc
  282. \= Expect no match
  283. abc\n
  284. No match
  285. abc\ndef
  286. No match
  287. /(a)(b)(c)(d)(e)\6/
  288. Failed: error 115 at offset 16: reference to non-existent subpattern
  289. /the quick brown fox/I
  290. Capture group count = 0
  291. First code unit = 't'
  292. Last code unit = 'x'
  293. Subject length lower bound = 19
  294. the quick brown fox
  295. 0: the quick brown fox
  296. this is a line with the quick brown fox
  297. 0: the quick brown fox
  298. /the quick brown fox/I,anchored
  299. Capture group count = 0
  300. Options: anchored
  301. First code unit = 't'
  302. Subject length lower bound = 19
  303. the quick brown fox
  304. 0: the quick brown fox
  305. \= Expect no match
  306. this is a line with the quick brown fox
  307. No match
  308. /ab(?z)cd/
  309. Failed: error 111 at offset 4: unrecognized character after (? or (?-
  310. /^abc|def/I
  311. Capture group count = 0
  312. Starting code units: a d
  313. Subject length lower bound = 3
  314. abcdef
  315. 0: abc
  316. abcdef\=notbol
  317. 0: def
  318. /.*((abc)$|(def))/I
  319. Capture group count = 3
  320. First code unit at start or follows newline
  321. Subject length lower bound = 3
  322. defabc
  323. 0: defabc
  324. 1: abc
  325. 2: abc
  326. defabc\=noteol
  327. 0: def
  328. 1: def
  329. 2: <unset>
  330. 3: def
  331. /)/
  332. Failed: error 122 at offset 0: unmatched closing parenthesis
  333. /a[]b/
  334. Failed: error 106 at offset 4: missing terminating ] for character class
  335. /[^aeiou ]{3,}/I
  336. Capture group count = 0
  337. Starting code units: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x09 \x0a
  338. \x0b \x0c \x0d \x0e \x0f \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19
  339. \x1a \x1b \x1c \x1d \x1e \x1f ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6
  340. 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [
  341. \ ] ^ _ ` b c d f g h j k l m n p q r s t v w x y z { | } ~ \x7f \x80 \x81
  342. \x82 \x83 \x84 \x85 \x86 \x87 \x88 \x89 \x8a \x8b \x8c \x8d \x8e \x8f \x90
  343. \x91 \x92 \x93 \x94 \x95 \x96 \x97 \x98 \x99 \x9a \x9b \x9c \x9d \x9e \x9f
  344. \xa0 \xa1 \xa2 \xa3 \xa4 \xa5 \xa6 \xa7 \xa8 \xa9 \xaa \xab \xac \xad \xae
  345. \xaf \xb0 \xb1 \xb2 \xb3 \xb4 \xb5 \xb6 \xb7 \xb8 \xb9 \xba \xbb \xbc \xbd
  346. \xbe \xbf \xc0 \xc1 \xc2 \xc3 \xc4 \xc5 \xc6 \xc7 \xc8 \xc9 \xca \xcb \xcc
  347. \xcd \xce \xcf \xd0 \xd1 \xd2 \xd3 \xd4 \xd5 \xd6 \xd7 \xd8 \xd9 \xda \xdb
  348. \xdc \xdd \xde \xdf \xe0 \xe1 \xe2 \xe3 \xe4 \xe5 \xe6 \xe7 \xe8 \xe9 \xea
  349. \xeb \xec \xed \xee \xef \xf0 \xf1 \xf2 \xf3 \xf4 \xf5 \xf6 \xf7 \xf8 \xf9
  350. \xfa \xfb \xfc \xfd \xfe \xff
  351. Subject length lower bound = 3
  352. co-processors, and for
  353. 0: -pr
  354. /<.*>/I
  355. Capture group count = 0
  356. First code unit = '<'
  357. Last code unit = '>'
  358. Subject length lower bound = 2
  359. abc<def>ghi<klm>nop
  360. 0: <def>ghi<klm>
  361. /<.*?>/I
  362. Capture group count = 0
  363. First code unit = '<'
  364. Last code unit = '>'
  365. Subject length lower bound = 2
  366. abc<def>ghi<klm>nop
  367. 0: <def>
  368. /<.*>/I,ungreedy
  369. Capture group count = 0
  370. Options: ungreedy
  371. First code unit = '<'
  372. Last code unit = '>'
  373. Subject length lower bound = 2
  374. abc<def>ghi<klm>nop
  375. 0: <def>
  376. /(?U)<.*>/I
  377. Capture group count = 0
  378. First code unit = '<'
  379. Last code unit = '>'
  380. Subject length lower bound = 2
  381. abc<def>ghi<klm>nop
  382. 0: <def>
  383. /<.*?>/I,ungreedy
  384. Capture group count = 0
  385. Options: ungreedy
  386. First code unit = '<'
  387. Last code unit = '>'
  388. Subject length lower bound = 2
  389. abc<def>ghi<klm>nop
  390. 0: <def>ghi<klm>
  391. /={3,}/I,ungreedy
  392. Capture group count = 0
  393. Options: ungreedy
  394. First code unit = '='
  395. Last code unit = '='
  396. Subject length lower bound = 3
  397. abc========def
  398. 0: ===
  399. /(?U)={3,}?/I
  400. Capture group count = 0
  401. First code unit = '='
  402. Last code unit = '='
  403. Subject length lower bound = 3
  404. abc========def
  405. 0: ========
  406. /(?<!bar|cattle)foo/I
  407. Capture group count = 0
  408. Max lookbehind = 6
  409. First code unit = 'f'
  410. Last code unit = 'o'
  411. Subject length lower bound = 3
  412. foo
  413. 0: foo
  414. catfoo
  415. 0: foo
  416. \= Expect no match
  417. the barfoo
  418. No match
  419. and cattlefoo
  420. No match
  421. /abc(?<=a+)b/
  422. Failed: error 125 at offset 3: lookbehind assertion is not fixed length
  423. /12345(?<=aaa|b{0,3})b/
  424. Failed: error 125 at offset 5: lookbehind assertion is not fixed length
  425. /(?<!(foo)a\1)bar/
  426. /(?i)abc/I
  427. Capture group count = 0
  428. First code unit = 'a' (caseless)
  429. Last code unit = 'c' (caseless)
  430. Subject length lower bound = 3
  431. /(a|(?m)a)/I
  432. Capture group count = 1
  433. First code unit = 'a'
  434. Subject length lower bound = 1
  435. /(?i)^1234/I
  436. Capture group count = 0
  437. Compile options: <none>
  438. Overall options: anchored
  439. First code unit = '1'
  440. Subject length lower bound = 4
  441. /(^b|(?i)^d)/I
  442. Capture group count = 1
  443. Compile options: <none>
  444. Overall options: anchored
  445. Starting code units: D b d
  446. Subject length lower bound = 1
  447. /(?s).*/I
  448. Capture group count = 0
  449. May match empty string
  450. Compile options: <none>
  451. Overall options: anchored
  452. Subject length lower bound = 0
  453. /[abcd]/I
  454. Capture group count = 0
  455. Starting code units: a b c d
  456. Subject length lower bound = 1
  457. /(?i)[abcd]/I
  458. Capture group count = 0
  459. Starting code units: A B C D a b c d
  460. Subject length lower bound = 1
  461. /(?m)[xy]|(b|c)/I
  462. Capture group count = 1
  463. Starting code units: b c x y
  464. Subject length lower bound = 1
  465. /(^a|^b)/Im
  466. Capture group count = 1
  467. Options: multiline
  468. First code unit at start or follows newline
  469. Subject length lower bound = 1
  470. /(?i)(^a|^b)/Im
  471. Capture group count = 1
  472. Options: multiline
  473. First code unit at start or follows newline
  474. Subject length lower bound = 1
  475. /(a)(?(1)a|b|c)/
  476. Failed: error 127 at offset 3: conditional subpattern contains more than two branches
  477. /(?(?=a)a|b|c)/
  478. Failed: error 127 at offset 0: conditional subpattern contains more than two branches
  479. /(?(1a)/
  480. Failed: error 124 at offset 4: missing closing parenthesis for condition
  481. /(?(1a))/
  482. Failed: error 124 at offset 4: missing closing parenthesis for condition
  483. /(?(?i))/
  484. Failed: error 128 at offset 2: assertion expected after (?( or (?(?C)
  485. /(?(abc))/
  486. Failed: error 115 at offset 3: reference to non-existent subpattern
  487. /(?(?<ab))/
  488. Failed: error 128 at offset 2: assertion expected after (?( or (?(?C)
  489. /((?s)blah)\s+\1/I
  490. Capture group count = 1
  491. Max back reference = 1
  492. First code unit = 'b'
  493. Last code unit = 'h'
  494. Subject length lower bound = 9
  495. /((?i)blah)\s+\1/I
  496. Capture group count = 1
  497. Max back reference = 1
  498. First code unit = 'b' (caseless)
  499. Last code unit = 'h' (caseless)
  500. Subject length lower bound = 9
  501. /((?i)b)/IB
  502. ------------------------------------------------------------------
  503. Bra
  504. CBra 1
  505. /i b
  506. Ket
  507. Ket
  508. End
  509. ------------------------------------------------------------------
  510. Capture group count = 1
  511. First code unit = 'b' (caseless)
  512. Subject length lower bound = 1
  513. /(a*b|(?i:c*(?-i)d))/I
  514. Capture group count = 1
  515. Starting code units: C a b c d
  516. Subject length lower bound = 1
  517. /a$/I
  518. Capture group count = 0
  519. First code unit = 'a'
  520. Subject length lower bound = 1
  521. a
  522. 0: a
  523. a\n
  524. 0: a
  525. \= Expect no match
  526. a\=noteol
  527. No match
  528. a\n\=noteol
  529. No match
  530. /a$/Im
  531. Capture group count = 0
  532. Options: multiline
  533. First code unit = 'a'
  534. Subject length lower bound = 1
  535. a
  536. 0: a
  537. a\n
  538. 0: a
  539. a\n\=noteol
  540. 0: a
  541. \= Expect no match
  542. a\=noteol
  543. No match
  544. /\Aabc/Im
  545. Capture group count = 0
  546. Max lookbehind = 1
  547. Compile options: multiline
  548. Overall options: anchored multiline
  549. First code unit = 'a'
  550. Subject length lower bound = 3
  551. /^abc/Im
  552. Capture group count = 0
  553. Options: multiline
  554. First code unit at start or follows newline
  555. Last code unit = 'c'
  556. Subject length lower bound = 3
  557. /^((a+)(?U)([ab]+)(?-U)([bc]+)(\w*))/I
  558. Capture group count = 5
  559. Compile options: <none>
  560. Overall options: anchored
  561. First code unit = 'a'
  562. Subject length lower bound = 3
  563. aaaaabbbbbcccccdef
  564. 0: aaaaabbbbbcccccdef
  565. 1: aaaaabbbbbcccccdef
  566. 2: aaaaa
  567. 3: b
  568. 4: bbbbccccc
  569. 5: def
  570. /(?<=foo)[ab]/I
  571. Capture group count = 0
  572. Max lookbehind = 3
  573. Starting code units: a b
  574. Subject length lower bound = 1
  575. /(?<!foo)(alpha|omega)/I
  576. Capture group count = 1
  577. Max lookbehind = 3
  578. Starting code units: a o
  579. Last code unit = 'a'
  580. Subject length lower bound = 5
  581. /(?!alphabet)[ab]/I
  582. Capture group count = 0
  583. Starting code units: a b
  584. Subject length lower bound = 1
  585. /(?<=foo\n)^bar/Im
  586. Capture group count = 0
  587. Max lookbehind = 4
  588. Contains explicit CR or LF match
  589. Options: multiline
  590. Last code unit = 'r'
  591. Subject length lower bound = 3
  592. foo\nbarbar
  593. 0: bar
  594. \= Expect no match
  595. rhubarb
  596. No match
  597. barbell
  598. No match
  599. abc\nbarton
  600. No match
  601. /^(?<=foo\n)bar/Im
  602. Capture group count = 0
  603. Max lookbehind = 4
  604. Contains explicit CR or LF match
  605. Options: multiline
  606. First code unit at start or follows newline
  607. Last code unit = 'r'
  608. Subject length lower bound = 3
  609. foo\nbarbar
  610. 0: bar
  611. \= Expect no match
  612. rhubarb
  613. No match
  614. barbell
  615. No match
  616. abc\nbarton
  617. No match
  618. /(?>^abc)/Im
  619. Capture group count = 0
  620. Options: multiline
  621. First code unit at start or follows newline
  622. Last code unit = 'c'
  623. Subject length lower bound = 3
  624. abc
  625. 0: abc
  626. def\nabc
  627. 0: abc
  628. \= Expect no match
  629. defabc
  630. No match
  631. /(?<=ab(c+)d)ef/
  632. Failed: error 125 at offset 0: lookbehind assertion is not fixed length
  633. /(?<=ab(?<=c+)d)ef/
  634. Failed: error 125 at offset 6: lookbehind assertion is not fixed length
  635. /(?<=ab(c|de)f)g/
  636. Failed: error 125 at offset 0: lookbehind assertion is not fixed length
  637. /The next three are in testinput2 because they have variable length branches/
  638. /(?<=bullock|donkey)-cart/I
  639. Capture group count = 0
  640. Max lookbehind = 7
  641. First code unit = '-'
  642. Last code unit = 't'
  643. Subject length lower bound = 5
  644. the bullock-cart
  645. 0: -cart
  646. a donkey-cart race
  647. 0: -cart
  648. \= Expect no match
  649. cart
  650. No match
  651. horse-and-cart
  652. No match
  653. /(?<=ab(?i)x|y|z)/I
  654. Capture group count = 0
  655. Max lookbehind = 3
  656. May match empty string
  657. Subject length lower bound = 0
  658. /(?>.*)(?<=(abcd)|(xyz))/I
  659. Capture group count = 2
  660. Max lookbehind = 4
  661. May match empty string
  662. Subject length lower bound = 0
  663. alphabetabcd
  664. 0: alphabetabcd
  665. 1: abcd
  666. endingxyz
  667. 0: endingxyz
  668. 1: <unset>
  669. 2: xyz
  670. /(?<=ab(?i)x(?-i)y|(?i)z|b)ZZ/I
  671. Capture group count = 0
  672. Max lookbehind = 4
  673. First code unit = 'Z'
  674. Last code unit = 'Z'
  675. Subject length lower bound = 2
  676. abxyZZ
  677. 0: ZZ
  678. abXyZZ
  679. 0: ZZ
  680. ZZZ
  681. 0: ZZ
  682. zZZ
  683. 0: ZZ
  684. bZZ
  685. 0: ZZ
  686. BZZ
  687. 0: ZZ
  688. \= Expect no match
  689. ZZ
  690. No match
  691. abXYZZ
  692. No match
  693. zzz
  694. No match
  695. bzz
  696. No match
  697. /(?<!(foo)a)bar/I
  698. Capture group count = 1
  699. Max lookbehind = 4
  700. First code unit = 'b'
  701. Last code unit = 'r'
  702. Subject length lower bound = 3
  703. bar
  704. 0: bar
  705. foobbar
  706. 0: bar
  707. \= Expect no match
  708. fooabar
  709. No match
  710. # Perl does not fail these two for the final subjects.
  711. /^(xa|=?\1a){2}$/
  712. xa=xaa
  713. 0: xa=xaa
  714. 1: =xaa
  715. \= Expect no match
  716. xa=xaaa
  717. No match
  718. /^(xa|=?\1a)+$/
  719. xa=xaa
  720. 0: xa=xaa
  721. 1: =xaa
  722. \= Expect no match
  723. xa=xaaa
  724. No match
  725. # These are syntax tests from Perl 5.005
  726. /a[b-a]/
  727. Failed: error 108 at offset 4: range out of order in character class
  728. /a[]b/
  729. Failed: error 106 at offset 4: missing terminating ] for character class
  730. /a[/
  731. Failed: error 106 at offset 2: missing terminating ] for character class
  732. /*a/
  733. Failed: error 109 at offset 0: quantifier does not follow a repeatable item
  734. /(*)b/
  735. Failed: error 109 at offset 1: quantifier does not follow a repeatable item
  736. /abc)/
  737. Failed: error 122 at offset 3: unmatched closing parenthesis
  738. /(abc/
  739. Failed: error 114 at offset 4: missing closing parenthesis
  740. /a**/
  741. Failed: error 109 at offset 2: quantifier does not follow a repeatable item
  742. /)(/
  743. Failed: error 122 at offset 0: unmatched closing parenthesis
  744. /\1/
  745. Failed: error 115 at offset 1: reference to non-existent subpattern
  746. /\2/
  747. Failed: error 115 at offset 1: reference to non-existent subpattern
  748. /(a)|\2/
  749. Failed: error 115 at offset 5: reference to non-existent subpattern
  750. /a[b-a]/Ii
  751. Failed: error 108 at offset 4: range out of order in character class
  752. /a[]b/Ii
  753. Failed: error 106 at offset 4: missing terminating ] for character class
  754. /a[/Ii
  755. Failed: error 106 at offset 2: missing terminating ] for character class
  756. /*a/Ii
  757. Failed: error 109 at offset 0: quantifier does not follow a repeatable item
  758. /(*)b/Ii
  759. Failed: error 109 at offset 1: quantifier does not follow a repeatable item
  760. /abc)/Ii
  761. Failed: error 122 at offset 3: unmatched closing parenthesis
  762. /(abc/Ii
  763. Failed: error 114 at offset 4: missing closing parenthesis
  764. /a**/Ii
  765. Failed: error 109 at offset 2: quantifier does not follow a repeatable item
  766. /)(/Ii
  767. Failed: error 122 at offset 0: unmatched closing parenthesis
  768. /:(?:/
  769. Failed: error 114 at offset 4: missing closing parenthesis
  770. /(?<%)b/
  771. Failed: error 162 at offset 3: subpattern name expected
  772. /a(?{)b/
  773. Failed: error 111 at offset 3: unrecognized character after (? or (?-
  774. /a(?{{})b/
  775. Failed: error 111 at offset 3: unrecognized character after (? or (?-
  776. /a(?{}})b/
  777. Failed: error 111 at offset 3: unrecognized character after (? or (?-
  778. /a(?{"{"})b/
  779. Failed: error 111 at offset 3: unrecognized character after (? or (?-
  780. /a(?{"{"}})b/
  781. Failed: error 111 at offset 3: unrecognized character after (? or (?-
  782. /(?(1?)a|b)/
  783. Failed: error 124 at offset 4: missing closing parenthesis for condition
  784. /[a[:xyz:/
  785. Failed: error 106 at offset 8: missing terminating ] for character class
  786. /(?<=x+)y/
  787. Failed: error 125 at offset 0: lookbehind assertion is not fixed length
  788. /a{37,17}/
  789. Failed: error 104 at offset 7: numbers out of order in {} quantifier
  790. /abc/\
  791. Failed: error 101 at offset 4: \ at end of pattern
  792. /abc/\i
  793. Failed: error 101 at offset 4: \ at end of pattern
  794. /(a)bc(d)/I
  795. Capture group count = 2
  796. First code unit = 'a'
  797. Last code unit = 'd'
  798. Subject length lower bound = 4
  799. abcd
  800. 0: abcd
  801. 1: a
  802. 2: d
  803. abcd\=copy=2
  804. 0: abcd
  805. 1: a
  806. 2: d
  807. 2C d (1)
  808. abcd\=copy=5
  809. 0: abcd
  810. 1: a
  811. 2: d
  812. Copy substring 5 failed (-49): unknown substring
  813. /(.{20})/I
  814. Capture group count = 1
  815. Subject length lower bound = 20
  816. abcdefghijklmnopqrstuvwxyz
  817. 0: abcdefghijklmnopqrst
  818. 1: abcdefghijklmnopqrst
  819. abcdefghijklmnopqrstuvwxyz\=copy=1
  820. 0: abcdefghijklmnopqrst
  821. 1: abcdefghijklmnopqrst
  822. 1C abcdefghijklmnopqrst (20)
  823. abcdefghijklmnopqrstuvwxyz\=get=1
  824. 0: abcdefghijklmnopqrst
  825. 1: abcdefghijklmnopqrst
  826. 1G abcdefghijklmnopqrst (20)
  827. /(.{15})/I
  828. Capture group count = 1
  829. Subject length lower bound = 15
  830. abcdefghijklmnopqrstuvwxyz
  831. 0: abcdefghijklmno
  832. 1: abcdefghijklmno
  833. abcdefghijklmnopqrstuvwxyz\=copy=1,get=1
  834. 0: abcdefghijklmno
  835. 1: abcdefghijklmno
  836. 1C abcdefghijklmno (15)
  837. 1G abcdefghijklmno (15)
  838. /(.{16})/I
  839. Capture group count = 1
  840. Subject length lower bound = 16
  841. abcdefghijklmnopqrstuvwxyz
  842. 0: abcdefghijklmnop
  843. 1: abcdefghijklmnop
  844. abcdefghijklmnopqrstuvwxyz\=copy=1,get=1,getall
  845. 0: abcdefghijklmnop
  846. 1: abcdefghijklmnop
  847. 1C abcdefghijklmnop (16)
  848. 1G abcdefghijklmnop (16)
  849. 0L abcdefghijklmnop
  850. 1L abcdefghijklmnop
  851. /^(a|(bc))de(f)/I
  852. Capture group count = 3
  853. Compile options: <none>
  854. Overall options: anchored
  855. Starting code units: a b
  856. Subject length lower bound = 4
  857. adef\=get=1,get=2,get=3,get=4,getall
  858. 0: adef
  859. 1: a
  860. 2: <unset>
  861. 3: f
  862. 1G a (1)
  863. Get substring 2 failed (-55): requested value is not set
  864. 3G f (1)
  865. Get substring 4 failed (-49): unknown substring
  866. 0L adef
  867. 1L a
  868. 2L
  869. 3L f
  870. bcdef\=get=1,get=2,get=3,get=4,getall
  871. 0: bcdef
  872. 1: bc
  873. 2: bc
  874. 3: f
  875. 1G bc (2)
  876. 2G bc (2)
  877. 3G f (1)
  878. Get substring 4 failed (-49): unknown substring
  879. 0L bcdef
  880. 1L bc
  881. 2L bc
  882. 3L f
  883. adefghijk\=copy=0
  884. 0: adef
  885. 1: a
  886. 2: <unset>
  887. 3: f
  888. 0C adef (4)
  889. /^abc\00def/I
  890. Capture group count = 0
  891. Compile options: <none>
  892. Overall options: anchored
  893. First code unit = 'a'
  894. Subject length lower bound = 7
  895. abc\00def\=copy=0,getall
  896. 0: abc\x00def
  897. 0C abc\x00def (7)
  898. 0L abc\x00def
  899. /word ((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+
  900. )((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+
  901. )?)?)?)?)?)?)?)?)?otherword/I
  902. Capture group count = 8
  903. Contains explicit CR or LF match
  904. First code unit = 'w'
  905. Last code unit = 'd'
  906. Subject length lower bound = 14
  907. /.*X/IB
  908. ------------------------------------------------------------------
  909. Bra
  910. Any*
  911. X
  912. Ket
  913. End
  914. ------------------------------------------------------------------
  915. Capture group count = 0
  916. First code unit at start or follows newline
  917. Last code unit = 'X'
  918. Subject length lower bound = 1
  919. /.*X/IBs
  920. ------------------------------------------------------------------
  921. Bra
  922. AllAny*
  923. X
  924. Ket
  925. End
  926. ------------------------------------------------------------------
  927. Capture group count = 0
  928. Compile options: dotall
  929. Overall options: anchored dotall
  930. Last code unit = 'X'
  931. Subject length lower bound = 1
  932. /(.*X|^B)/IB
  933. ------------------------------------------------------------------
  934. Bra
  935. CBra 1
  936. Any*
  937. X
  938. Alt
  939. ^
  940. B
  941. Ket
  942. Ket
  943. End
  944. ------------------------------------------------------------------
  945. Capture group count = 1
  946. First code unit at start or follows newline
  947. Subject length lower bound = 1
  948. /(.*X|^B)/IBs
  949. ------------------------------------------------------------------
  950. Bra
  951. CBra 1
  952. AllAny*
  953. X
  954. Alt
  955. ^
  956. B
  957. Ket
  958. Ket
  959. End
  960. ------------------------------------------------------------------
  961. Capture group count = 1
  962. Compile options: dotall
  963. Overall options: anchored dotall
  964. Subject length lower bound = 1
  965. /(?s)(.*X|^B)/IB
  966. ------------------------------------------------------------------
  967. Bra
  968. CBra 1
  969. AllAny*
  970. X
  971. Alt
  972. ^
  973. B
  974. Ket
  975. Ket
  976. End
  977. ------------------------------------------------------------------
  978. Capture group count = 1
  979. Compile options: <none>
  980. Overall options: anchored
  981. Subject length lower bound = 1
  982. /(?s:.*X|^B)/IB
  983. ------------------------------------------------------------------
  984. Bra
  985. Bra
  986. AllAny*
  987. X
  988. Alt
  989. ^
  990. B
  991. Ket
  992. Ket
  993. End
  994. ------------------------------------------------------------------
  995. Capture group count = 0
  996. Compile options: <none>
  997. Overall options: anchored
  998. Subject length lower bound = 1
  999. /\Biss\B/I,aftertext
  1000. Capture group count = 0
  1001. Max lookbehind = 1
  1002. First code unit = 'i'
  1003. Last code unit = 's'
  1004. Subject length lower bound = 3
  1005. Mississippi
  1006. 0: iss
  1007. 0+ issippi
  1008. /iss/I,aftertext,altglobal
  1009. Capture group count = 0
  1010. First code unit = 'i'
  1011. Last code unit = 's'
  1012. Subject length lower bound = 3
  1013. Mississippi
  1014. 0: iss
  1015. 0+ issippi
  1016. 0: iss
  1017. 0+ ippi
  1018. /\Biss\B/I,aftertext,altglobal
  1019. Capture group count = 0
  1020. Max lookbehind = 1
  1021. First code unit = 'i'
  1022. Last code unit = 's'
  1023. Subject length lower bound = 3
  1024. Mississippi
  1025. 0: iss
  1026. 0+ issippi
  1027. /\Biss\B/Ig,aftertext
  1028. Capture group count = 0
  1029. Max lookbehind = 1
  1030. First code unit = 'i'
  1031. Last code unit = 's'
  1032. Subject length lower bound = 3
  1033. Mississippi
  1034. 0: iss
  1035. 0+ issippi
  1036. 0: iss
  1037. 0+ ippi
  1038. \= Expect no match
  1039. Mississippi\=anchored
  1040. No match
  1041. /(?<=[Ms])iss/Ig,aftertext
  1042. Capture group count = 0
  1043. Max lookbehind = 1
  1044. First code unit = 'i'
  1045. Last code unit = 's'
  1046. Subject length lower bound = 3
  1047. Mississippi
  1048. 0: iss
  1049. 0+ issippi
  1050. 0: iss
  1051. 0+ ippi
  1052. /(?<=[Ms])iss/I,aftertext,altglobal
  1053. Capture group count = 0
  1054. Max lookbehind = 1
  1055. First code unit = 'i'
  1056. Last code unit = 's'
  1057. Subject length lower bound = 3
  1058. Mississippi
  1059. 0: iss
  1060. 0+ issippi
  1061. /^iss/Ig,aftertext
  1062. Capture group count = 0
  1063. Compile options: <none>
  1064. Overall options: anchored
  1065. First code unit = 'i'
  1066. Subject length lower bound = 3
  1067. ississippi
  1068. 0: iss
  1069. 0+ issippi
  1070. /.*iss/Ig,aftertext
  1071. Capture group count = 0
  1072. First code unit at start or follows newline
  1073. Last code unit = 's'
  1074. Subject length lower bound = 3
  1075. abciss\nxyzisspqr
  1076. 0: abciss
  1077. 0+ \x0axyzisspqr
  1078. 0: xyziss
  1079. 0+ pqr
  1080. /.i./Ig,aftertext
  1081. Capture group count = 0
  1082. Last code unit = 'i'
  1083. Subject length lower bound = 3
  1084. Mississippi
  1085. 0: Mis
  1086. 0+ sissippi
  1087. 0: sis
  1088. 0+ sippi
  1089. 0: sip
  1090. 0+ pi
  1091. Mississippi\=anchored
  1092. 0: Mis
  1093. 0+ sissippi
  1094. 0: sis
  1095. 0+ sippi
  1096. 0: sip
  1097. 0+ pi
  1098. Missouri river
  1099. 0: Mis
  1100. 0+ souri river
  1101. 0: ri
  1102. 0+ river
  1103. 0: riv
  1104. 0+ er
  1105. Missouri river\=anchored
  1106. 0: Mis
  1107. 0+ souri river
  1108. /^.is/Ig,aftertext
  1109. Capture group count = 0
  1110. Compile options: <none>
  1111. Overall options: anchored
  1112. Subject length lower bound = 3
  1113. Mississippi
  1114. 0: Mis
  1115. 0+ sissippi
  1116. /^ab\n/Ig,aftertext
  1117. Capture group count = 0
  1118. Contains explicit CR or LF match
  1119. Compile options: <none>
  1120. Overall options: anchored
  1121. First code unit = 'a'
  1122. Subject length lower bound = 3
  1123. ab\nab\ncd
  1124. 0: ab\x0a
  1125. 0+ ab\x0acd
  1126. /^ab\n/Igm,aftertext
  1127. Capture group count = 0
  1128. Contains explicit CR or LF match
  1129. Options: multiline
  1130. First code unit at start or follows newline
  1131. Last code unit = \x0a
  1132. Subject length lower bound = 3
  1133. ab\nab\ncd
  1134. 0: ab\x0a
  1135. 0+ ab\x0acd
  1136. 0: ab\x0a
  1137. 0+ cd
  1138. /^/gm,newline=any
  1139. a\rb\nc\r\nxyz\=aftertext
  1140. 0:
  1141. 0+ a\x0db\x0ac\x0d\x0axyz
  1142. 0:
  1143. 0+ b\x0ac\x0d\x0axyz
  1144. 0:
  1145. 0+ c\x0d\x0axyz
  1146. 0:
  1147. 0+ xyz
  1148. /abc/I
  1149. Capture group count = 0
  1150. First code unit = 'a'
  1151. Last code unit = 'c'
  1152. Subject length lower bound = 3
  1153. /abc|bac/I
  1154. Capture group count = 0
  1155. Starting code units: a b
  1156. Last code unit = 'c'
  1157. Subject length lower bound = 3
  1158. /(abc|bac)/I
  1159. Capture group count = 1
  1160. Starting code units: a b
  1161. Last code unit = 'c'
  1162. Subject length lower bound = 3
  1163. /(abc|(c|dc))/I
  1164. Capture group count = 2
  1165. Starting code units: a c d
  1166. Last code unit = 'c'
  1167. Subject length lower bound = 1
  1168. /(abc|(d|de)c)/I
  1169. Capture group count = 2
  1170. Starting code units: a d
  1171. Last code unit = 'c'
  1172. Subject length lower bound = 2
  1173. /a*/I
  1174. Capture group count = 0
  1175. May match empty string
  1176. Subject length lower bound = 0
  1177. /a+/I
  1178. Capture group count = 0
  1179. First code unit = 'a'
  1180. Subject length lower bound = 1
  1181. /(baa|a+)/I
  1182. Capture group count = 1
  1183. Starting code units: a b
  1184. Last code unit = 'a'
  1185. Subject length lower bound = 1
  1186. /a{0,3}/I
  1187. Capture group count = 0
  1188. May match empty string
  1189. Subject length lower bound = 0
  1190. /baa{3,}/I
  1191. Capture group count = 0
  1192. First code unit = 'b'
  1193. Last code unit = 'a'
  1194. Subject length lower bound = 5
  1195. /"([^\\"]+|\\.)*"/I
  1196. Capture group count = 1
  1197. First code unit = '"'
  1198. Last code unit = '"'
  1199. Subject length lower bound = 2
  1200. /(abc|ab[cd])/I
  1201. Capture group count = 1
  1202. First code unit = 'a'
  1203. Subject length lower bound = 3
  1204. /(a|.)/I
  1205. Capture group count = 1
  1206. Subject length lower bound = 1
  1207. /a|ba|\w/I
  1208. Capture group count = 0
  1209. Starting code units: 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P
  1210. Q R S T U V W X Y Z _ a b c d e f g h i j k l m n o p q r s t u v w x y z
  1211. Subject length lower bound = 1
  1212. /abc(?=pqr)/I
  1213. Capture group count = 0
  1214. First code unit = 'a'
  1215. Last code unit = 'r'
  1216. Subject length lower bound = 3
  1217. /...(?<=abc)/I
  1218. Capture group count = 0
  1219. Max lookbehind = 3
  1220. Subject length lower bound = 3
  1221. /abc(?!pqr)/I
  1222. Capture group count = 0
  1223. First code unit = 'a'
  1224. Last code unit = 'c'
  1225. Subject length lower bound = 3
  1226. /ab./I
  1227. Capture group count = 0
  1228. First code unit = 'a'
  1229. Last code unit = 'b'
  1230. Subject length lower bound = 3
  1231. /ab[xyz]/I
  1232. Capture group count = 0
  1233. First code unit = 'a'
  1234. Last code unit = 'b'
  1235. Subject length lower bound = 3
  1236. /abc*/I
  1237. Capture group count = 0
  1238. First code unit = 'a'
  1239. Last code unit = 'b'
  1240. Subject length lower bound = 2
  1241. /ab.c*/I
  1242. Capture group count = 0
  1243. First code unit = 'a'
  1244. Last code unit = 'b'
  1245. Subject length lower bound = 3
  1246. /a.c*/I
  1247. Capture group count = 0
  1248. First code unit = 'a'
  1249. Subject length lower bound = 2
  1250. /.c*/I
  1251. Capture group count = 0
  1252. Subject length lower bound = 1
  1253. /ac*/I
  1254. Capture group count = 0
  1255. First code unit = 'a'
  1256. Subject length lower bound = 1
  1257. /(a.c*|b.c*)/I
  1258. Capture group count = 1
  1259. Starting code units: a b
  1260. Subject length lower bound = 2
  1261. /a.c*|aba/I
  1262. Capture group count = 0
  1263. First code unit = 'a'
  1264. Subject length lower bound = 2
  1265. /.+a/I
  1266. Capture group count = 0
  1267. Last code unit = 'a'
  1268. Subject length lower bound = 2
  1269. /(?=abcda)a.*/I
  1270. Capture group count = 0
  1271. First code unit = 'a'
  1272. Last code unit = 'a'
  1273. Subject length lower bound = 2
  1274. /(?=a)a.*/I
  1275. Capture group count = 0
  1276. First code unit = 'a'
  1277. Subject length lower bound = 1
  1278. /a(b)*/I
  1279. Capture group count = 1
  1280. First code unit = 'a'
  1281. Subject length lower bound = 1
  1282. /a\d*/I
  1283. Capture group count = 0
  1284. First code unit = 'a'
  1285. Subject length lower bound = 1
  1286. /ab\d*/I
  1287. Capture group count = 0
  1288. First code unit = 'a'
  1289. Last code unit = 'b'
  1290. Subject length lower bound = 2
  1291. /a(\d)*/I
  1292. Capture group count = 1
  1293. First code unit = 'a'
  1294. Subject length lower bound = 1
  1295. /abcde{0,0}/I
  1296. Capture group count = 0
  1297. First code unit = 'a'
  1298. Last code unit = 'd'
  1299. Subject length lower bound = 4
  1300. /ab\d+/I
  1301. Capture group count = 0
  1302. First code unit = 'a'
  1303. Last code unit = 'b'
  1304. Subject length lower bound = 3
  1305. /a(?(1)b)(.)/I
  1306. Capture group count = 1
  1307. Max back reference = 1
  1308. First code unit = 'a'
  1309. Subject length lower bound = 2
  1310. /a(?(1)bag|big)(.)/I
  1311. Capture group count = 1
  1312. Max back reference = 1
  1313. First code unit = 'a'
  1314. Last code unit = 'g'
  1315. Subject length lower bound = 5
  1316. /a(?(1)bag|big)*(.)/I
  1317. Capture group count = 1
  1318. Max back reference = 1
  1319. First code unit = 'a'
  1320. Subject length lower bound = 2
  1321. /a(?(1)bag|big)+(.)/I
  1322. Capture group count = 1
  1323. Max back reference = 1
  1324. First code unit = 'a'
  1325. Last code unit = 'g'
  1326. Subject length lower bound = 5
  1327. /a(?(1)b..|b..)(.)/I
  1328. Capture group count = 1
  1329. Max back reference = 1
  1330. First code unit = 'a'
  1331. Last code unit = 'b'
  1332. Subject length lower bound = 5
  1333. /ab\d{0}e/I
  1334. Capture group count = 0
  1335. First code unit = 'a'
  1336. Last code unit = 'e'
  1337. Subject length lower bound = 3
  1338. /a?b?/I
  1339. Capture group count = 0
  1340. May match empty string
  1341. Subject length lower bound = 0
  1342. a
  1343. 0: a
  1344. b
  1345. 0: b
  1346. ab
  1347. 0: ab
  1348. \
  1349. 0:
  1350. \= Expect no match
  1351. \=notempty
  1352. No match
  1353. /|-/I
  1354. Capture group count = 0
  1355. May match empty string
  1356. Subject length lower bound = 0
  1357. abcd
  1358. 0:
  1359. -abc
  1360. 0:
  1361. ab-c\=notempty
  1362. 0: -
  1363. \= Expect no match
  1364. abc\=notempty
  1365. No match
  1366. /^.?abcd/I
  1367. Capture group count = 0
  1368. Compile options: <none>
  1369. Overall options: anchored
  1370. Last code unit = 'd'
  1371. Subject length lower bound = 4
  1372. /\( # ( at start
  1373. (?: # Non-capturing bracket
  1374. (?>[^()]+) # Either a sequence of non-brackets (no backtracking)
  1375. | # Or
  1376. (?R) # Recurse - i.e. nested bracketed string
  1377. )* # Zero or more contents
  1378. \) # Closing )
  1379. /Ix
  1380. Capture group count = 0
  1381. Options: extended
  1382. First code unit = '('
  1383. Last code unit = ')'
  1384. Subject length lower bound = 2
  1385. (abcd)
  1386. 0: (abcd)
  1387. (abcd)xyz
  1388. 0: (abcd)
  1389. xyz(abcd)
  1390. 0: (abcd)
  1391. (ab(xy)cd)pqr
  1392. 0: (ab(xy)cd)
  1393. (ab(xycd)pqr
  1394. 0: (xycd)
  1395. () abc ()
  1396. 0: ()
  1397. 12(abcde(fsh)xyz(foo(bar))lmno)89
  1398. 0: (abcde(fsh)xyz(foo(bar))lmno)
  1399. \= Expect no match
  1400. abcd
  1401. No match
  1402. abcd)
  1403. No match
  1404. (abcd
  1405. No match
  1406. /\( ( (?>[^()]+) | (?R) )* \) /Igx
  1407. Capture group count = 1
  1408. Options: extended
  1409. First code unit = '('
  1410. Last code unit = ')'
  1411. Subject length lower bound = 2
  1412. (ab(xy)cd)pqr
  1413. 0: (ab(xy)cd)
  1414. 1: cd
  1415. 1(abcd)(x(y)z)pqr
  1416. 0: (abcd)
  1417. 1: abcd
  1418. 0: (x(y)z)
  1419. 1: z
  1420. /\( (?: (?>[^()]+) | (?R) ) \) /Ix
  1421. Capture group count = 0
  1422. Options: extended
  1423. First code unit = '('
  1424. Last code unit = ')'
  1425. Subject length lower bound = 3
  1426. (abcd)
  1427. 0: (abcd)
  1428. (ab(xy)cd)
  1429. 0: (xy)
  1430. (a(b(c)d)e)
  1431. 0: (c)
  1432. ((ab))
  1433. 0: ((ab))
  1434. \= Expect no match
  1435. ()
  1436. No match
  1437. /\( (?: (?>[^()]+) | (?R) )? \) /Ix
  1438. Capture group count = 0
  1439. Options: extended
  1440. First code unit = '('
  1441. Last code unit = ')'
  1442. Subject length lower bound = 2
  1443. ()
  1444. 0: ()
  1445. 12(abcde(fsh)xyz(foo(bar))lmno)89
  1446. 0: (fsh)
  1447. /\( ( (?>[^()]+) | (?R) )* \) /Ix
  1448. Capture group count = 1
  1449. Options: extended
  1450. First code unit = '('
  1451. Last code unit = ')'
  1452. Subject length lower bound = 2
  1453. (ab(xy)cd)
  1454. 0: (ab(xy)cd)
  1455. 1: cd
  1456. /\( ( ( (?>[^()]+) | (?R) )* ) \) /Ix
  1457. Capture group count = 2
  1458. Options: extended
  1459. First code unit = '('
  1460. Last code unit = ')'
  1461. Subject length lower bound = 2
  1462. (ab(xy)cd)
  1463. 0: (ab(xy)cd)
  1464. 1: ab(xy)cd
  1465. 2: cd
  1466. /\( (123)? ( ( (?>[^()]+) | (?R) )* ) \) /Ix
  1467. Capture group count = 3
  1468. Options: extended
  1469. First code unit = '('
  1470. Last code unit = ')'
  1471. Subject length lower bound = 2
  1472. (ab(xy)cd)
  1473. 0: (ab(xy)cd)
  1474. 1: <unset>
  1475. 2: ab(xy)cd
  1476. 3: cd
  1477. (123ab(xy)cd)
  1478. 0: (123ab(xy)cd)
  1479. 1: 123
  1480. 2: ab(xy)cd
  1481. 3: cd
  1482. /\( ( (123)? ( (?>[^()]+) | (?R) )* ) \) /Ix
  1483. Capture group count = 3
  1484. Options: extended
  1485. First code unit = '('
  1486. Last code unit = ')'
  1487. Subject length lower bound = 2
  1488. (ab(xy)cd)
  1489. 0: (ab(xy)cd)
  1490. 1: ab(xy)cd
  1491. 2: <unset>
  1492. 3: cd
  1493. (123ab(xy)cd)
  1494. 0: (123ab(xy)cd)
  1495. 1: 123ab(xy)cd
  1496. 2: 123
  1497. 3: cd
  1498. /\( (((((((((( ( (?>[^()]+) | (?R) )* )))))))))) \) /Ix
  1499. Capture group count = 11
  1500. Options: extended
  1501. First code unit = '('
  1502. Last code unit = ')'
  1503. Subject length lower bound = 2
  1504. (ab(xy)cd)
  1505. 0: (ab(xy)cd)
  1506. 1: ab(xy)cd
  1507. 2: ab(xy)cd
  1508. 3: ab(xy)cd
  1509. 4: ab(xy)cd
  1510. 5: ab(xy)cd
  1511. 6: ab(xy)cd
  1512. 7: ab(xy)cd
  1513. 8: ab(xy)cd
  1514. 9: ab(xy)cd
  1515. 10: ab(xy)cd
  1516. 11: cd
  1517. /\( ( ( (?>[^()<>]+) | ((?>[^()]+)) | (?R) )* ) \) /Ix
  1518. Capture group count = 3
  1519. Options: extended
  1520. First code unit = '('
  1521. Last code unit = ')'
  1522. Subject length lower bound = 2
  1523. (abcd(xyz<p>qrs)123)
  1524. 0: (abcd(xyz<p>qrs)123)
  1525. 1: abcd(xyz<p>qrs)123
  1526. 2: 123
  1527. /\( ( ( (?>[^()]+) | ((?R)) )* ) \) /Ix
  1528. Capture group count = 3
  1529. Options: extended
  1530. First code unit = '('
  1531. Last code unit = ')'
  1532. Subject length lower bound = 2
  1533. (ab(cd)ef)
  1534. 0: (ab(cd)ef)
  1535. 1: ab(cd)ef
  1536. 2: ef
  1537. 3: (cd)
  1538. (ab(cd(ef)gh)ij)
  1539. 0: (ab(cd(ef)gh)ij)
  1540. 1: ab(cd(ef)gh)ij
  1541. 2: ij
  1542. 3: (cd(ef)gh)
  1543. /^[[:alnum:]]/IB
  1544. ------------------------------------------------------------------
  1545. Bra
  1546. ^
  1547. [0-9A-Za-z]
  1548. Ket
  1549. End
  1550. ------------------------------------------------------------------
  1551. Capture group count = 0
  1552. Compile options: <none>
  1553. Overall options: anchored
  1554. Starting code units: 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P
  1555. Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z
  1556. Subject length lower bound = 1
  1557. /^[[:^alnum:]]/IB
  1558. ------------------------------------------------------------------
  1559. Bra
  1560. ^
  1561. [\x00-/:-@[-`{-\xff] (neg)
  1562. Ket
  1563. End
  1564. ------------------------------------------------------------------
  1565. Capture group count = 0
  1566. Compile options: <none>
  1567. Overall options: anchored
  1568. Starting code units: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x09 \x0a
  1569. \x0b \x0c \x0d \x0e \x0f \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19
  1570. \x1a \x1b \x1c \x1d \x1e \x1f \x20 ! " # $ % & ' ( ) * + , - . / : ; < = >
  1571. ? @ [ \ ] ^ _ ` { | } ~ \x7f \x80 \x81 \x82 \x83 \x84 \x85 \x86 \x87 \x88
  1572. \x89 \x8a \x8b \x8c \x8d \x8e \x8f \x90 \x91 \x92 \x93 \x94 \x95 \x96 \x97
  1573. \x98 \x99 \x9a \x9b \x9c \x9d \x9e \x9f \xa0 \xa1 \xa2 \xa3 \xa4 \xa5 \xa6
  1574. \xa7 \xa8 \xa9 \xaa \xab \xac \xad \xae \xaf \xb0 \xb1 \xb2 \xb3 \xb4 \xb5
  1575. \xb6 \xb7 \xb8 \xb9 \xba \xbb \xbc \xbd \xbe \xbf \xc0 \xc1 \xc2 \xc3 \xc4
  1576. \xc5 \xc6 \xc7 \xc8 \xc9 \xca \xcb \xcc \xcd \xce \xcf \xd0 \xd1 \xd2 \xd3
  1577. \xd4 \xd5 \xd6 \xd7 \xd8 \xd9 \xda \xdb \xdc \xdd \xde \xdf \xe0 \xe1 \xe2
  1578. \xe3 \xe4 \xe5 \xe6 \xe7 \xe8 \xe9 \xea \xeb \xec \xed \xee \xef \xf0 \xf1
  1579. \xf2 \xf3 \xf4 \xf5 \xf6 \xf7 \xf8 \xf9 \xfa \xfb \xfc \xfd \xfe \xff
  1580. Subject length lower bound = 1
  1581. /^[[:alpha:]]/IB
  1582. ------------------------------------------------------------------
  1583. Bra
  1584. ^
  1585. [A-Za-z]
  1586. Ket
  1587. End
  1588. ------------------------------------------------------------------
  1589. Capture group count = 0
  1590. Compile options: <none>
  1591. Overall options: anchored
  1592. Starting code units: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
  1593. a b c d e f g h i j k l m n o p q r s t u v w x y z
  1594. Subject length lower bound = 1
  1595. /^[[:^alpha:]]/IB
  1596. ------------------------------------------------------------------
  1597. Bra
  1598. ^
  1599. [\x00-@[-`{-\xff] (neg)
  1600. Ket
  1601. End
  1602. ------------------------------------------------------------------
  1603. Capture group count = 0
  1604. Compile options: <none>
  1605. Overall options: anchored
  1606. Starting code units: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x09 \x0a
  1607. \x0b \x0c \x0d \x0e \x0f \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19
  1608. \x1a \x1b \x1c \x1d \x1e \x1f \x20 ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4
  1609. 5 6 7 8 9 : ; < = > ? @ [ \ ] ^ _ ` { | } ~ \x7f \x80 \x81 \x82 \x83 \x84
  1610. \x85 \x86 \x87 \x88 \x89 \x8a \x8b \x8c \x8d \x8e \x8f \x90 \x91 \x92 \x93
  1611. \x94 \x95 \x96 \x97 \x98 \x99 \x9a \x9b \x9c \x9d \x9e \x9f \xa0 \xa1 \xa2
  1612. \xa3 \xa4 \xa5 \xa6 \xa7 \xa8 \xa9 \xaa \xab \xac \xad \xae \xaf \xb0 \xb1
  1613. \xb2 \xb3 \xb4 \xb5 \xb6 \xb7 \xb8 \xb9 \xba \xbb \xbc \xbd \xbe \xbf \xc0
  1614. \xc1 \xc2 \xc3 \xc4 \xc5 \xc6 \xc7 \xc8 \xc9 \xca \xcb \xcc \xcd \xce \xcf
  1615. \xd0 \xd1 \xd2 \xd3 \xd4 \xd5 \xd6 \xd7 \xd8 \xd9 \xda \xdb \xdc \xdd \xde
  1616. \xdf \xe0 \xe1 \xe2 \xe3 \xe4 \xe5 \xe6 \xe7 \xe8 \xe9 \xea \xeb \xec \xed
  1617. \xee \xef \xf0 \xf1 \xf2 \xf3 \xf4 \xf5 \xf6 \xf7 \xf8 \xf9 \xfa \xfb \xfc
  1618. \xfd \xfe \xff
  1619. Subject length lower bound = 1
  1620. /[_[:alpha:]]/I
  1621. Capture group count = 0
  1622. Starting code units: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
  1623. _ a b c d e f g h i j k l m n o p q r s t u v w x y z
  1624. Subject length lower bound = 1
  1625. /^[[:ascii:]]/IB
  1626. ------------------------------------------------------------------
  1627. Bra
  1628. ^
  1629. [\x00-\x7f]
  1630. Ket
  1631. End
  1632. ------------------------------------------------------------------
  1633. Capture group count = 0
  1634. Compile options: <none>
  1635. Overall options: anchored
  1636. Starting code units: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x09 \x0a
  1637. \x0b \x0c \x0d \x0e \x0f \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19
  1638. \x1a \x1b \x1c \x1d \x1e \x1f \x20 ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4
  1639. 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y
  1640. Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~
  1641. \x7f
  1642. Subject length lower bound = 1
  1643. /^[[:^ascii:]]/IB
  1644. ------------------------------------------------------------------
  1645. Bra
  1646. ^
  1647. [\x80-\xff] (neg)
  1648. Ket
  1649. End
  1650. ------------------------------------------------------------------
  1651. Capture group count = 0
  1652. Compile options: <none>
  1653. Overall options: anchored
  1654. Starting code units: \x80 \x81 \x82 \x83 \x84 \x85 \x86 \x87 \x88 \x89 \x8a
  1655. \x8b \x8c \x8d \x8e \x8f \x90 \x91 \x92 \x93 \x94 \x95 \x96 \x97 \x98 \x99
  1656. \x9a \x9b \x9c \x9d \x9e \x9f \xa0 \xa1 \xa2 \xa3 \xa4 \xa5 \xa6 \xa7 \xa8
  1657. \xa9 \xaa \xab \xac \xad \xae \xaf \xb0 \xb1 \xb2 \xb3 \xb4 \xb5 \xb6 \xb7
  1658. \xb8 \xb9 \xba \xbb \xbc \xbd \xbe \xbf \xc0 \xc1 \xc2 \xc3 \xc4 \xc5 \xc6
  1659. \xc7 \xc8 \xc9 \xca \xcb \xcc \xcd \xce \xcf \xd0 \xd1 \xd2 \xd3 \xd4 \xd5
  1660. \xd6 \xd7 \xd8 \xd9 \xda \xdb \xdc \xdd \xde \xdf \xe0 \xe1 \xe2 \xe3 \xe4
  1661. \xe5 \xe6 \xe7 \xe8 \xe9 \xea \xeb \xec \xed \xee \xef \xf0 \xf1 \xf2 \xf3
  1662. \xf4 \xf5 \xf6 \xf7 \xf8 \xf9 \xfa \xfb \xfc \xfd \xfe \xff
  1663. Subject length lower bound = 1
  1664. /^[[:blank:]]/IB
  1665. ------------------------------------------------------------------
  1666. Bra
  1667. ^
  1668. [\x09 ]
  1669. Ket
  1670. End
  1671. ------------------------------------------------------------------
  1672. Capture group count = 0
  1673. Compile options: <none>
  1674. Overall options: anchored
  1675. Starting code units: \x09 \x20
  1676. Subject length lower bound = 1
  1677. /^[[:^blank:]]/IB
  1678. ------------------------------------------------------------------
  1679. Bra
  1680. ^
  1681. [\x00-\x08\x0a-\x1f!-\xff] (neg)
  1682. Ket
  1683. End
  1684. ------------------------------------------------------------------
  1685. Capture group count = 0
  1686. Compile options: <none>
  1687. Overall options: anchored
  1688. Starting code units: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x0a \x0b
  1689. \x0c \x0d \x0e \x0f \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19 \x1a
  1690. \x1b \x1c \x1d \x1e \x1f ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9
  1691. : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^
  1692. _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~ \x7f \x80
  1693. \x81 \x82 \x83 \x84 \x85 \x86 \x87 \x88 \x89 \x8a \x8b \x8c \x8d \x8e \x8f
  1694. \x90 \x91 \x92 \x93 \x94 \x95 \x96 \x97 \x98 \x99 \x9a \x9b \x9c \x9d \x9e
  1695. \x9f \xa0 \xa1 \xa2 \xa3 \xa4 \xa5 \xa6 \xa7 \xa8 \xa9 \xaa \xab \xac \xad
  1696. \xae \xaf \xb0 \xb1 \xb2 \xb3 \xb4 \xb5 \xb6 \xb7 \xb8 \xb9 \xba \xbb \xbc
  1697. \xbd \xbe \xbf \xc0 \xc1 \xc2 \xc3 \xc4 \xc5 \xc6 \xc7 \xc8 \xc9 \xca \xcb
  1698. \xcc \xcd \xce \xcf \xd0 \xd1 \xd2 \xd3 \xd4 \xd5 \xd6 \xd7 \xd8 \xd9 \xda
  1699. \xdb \xdc \xdd \xde \xdf \xe0 \xe1 \xe2 \xe3 \xe4 \xe5 \xe6 \xe7 \xe8 \xe9
  1700. \xea \xeb \xec \xed \xee \xef \xf0 \xf1 \xf2 \xf3 \xf4 \xf5 \xf6 \xf7 \xf8
  1701. \xf9 \xfa \xfb \xfc \xfd \xfe \xff
  1702. Subject length lower bound = 1
  1703. /[\n\x0b\x0c\x0d[:blank:]]/I
  1704. Capture group count = 0
  1705. Contains explicit CR or LF match
  1706. Starting code units: \x09 \x0a \x0b \x0c \x0d \x20
  1707. Subject length lower bound = 1
  1708. /^[[:cntrl:]]/IB
  1709. ------------------------------------------------------------------
  1710. Bra
  1711. ^
  1712. [\x00-\x1f\x7f]
  1713. Ket
  1714. End
  1715. ------------------------------------------------------------------
  1716. Capture group count = 0
  1717. Compile options: <none>
  1718. Overall options: anchored
  1719. Starting code units: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x09 \x0a
  1720. \x0b \x0c \x0d \x0e \x0f \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19
  1721. \x1a \x1b \x1c \x1d \x1e \x1f \x7f
  1722. Subject length lower bound = 1
  1723. /^[[:digit:]]/IB
  1724. ------------------------------------------------------------------
  1725. Bra
  1726. ^
  1727. [0-9]
  1728. Ket
  1729. End
  1730. ------------------------------------------------------------------
  1731. Capture group count = 0
  1732. Compile options: <none>
  1733. Overall options: anchored
  1734. Starting code units: 0 1 2 3 4 5 6 7 8 9
  1735. Subject length lower bound = 1
  1736. /^[[:graph:]]/IB
  1737. ------------------------------------------------------------------
  1738. Bra
  1739. ^
  1740. [!-~]
  1741. Ket
  1742. End
  1743. ------------------------------------------------------------------
  1744. Capture group count = 0
  1745. Compile options: <none>
  1746. Overall options: anchored
  1747. Starting code units: ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 :
  1748. ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _
  1749. ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~
  1750. Subject length lower bound = 1
  1751. /^[[:lower:]]/IB
  1752. ------------------------------------------------------------------
  1753. Bra
  1754. ^
  1755. [a-z]
  1756. Ket
  1757. End
  1758. ------------------------------------------------------------------
  1759. Capture group count = 0
  1760. Compile options: <none>
  1761. Overall options: anchored
  1762. Starting code units: a b c d e f g h i j k l m n o p q r s t u v w x y z
  1763. Subject length lower bound = 1
  1764. /^[[:print:]]/IB
  1765. ------------------------------------------------------------------
  1766. Bra
  1767. ^
  1768. [ -~]
  1769. Ket
  1770. End
  1771. ------------------------------------------------------------------
  1772. Capture group count = 0
  1773. Compile options: <none>
  1774. Overall options: anchored
  1775. Starting code units: \x20 ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8
  1776. 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ]
  1777. ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~
  1778. Subject length lower bound = 1
  1779. /^[[:punct:]]/IB
  1780. ------------------------------------------------------------------
  1781. Bra
  1782. ^
  1783. [!-/:-@[-`{-~]
  1784. Ket
  1785. End
  1786. ------------------------------------------------------------------
  1787. Capture group count = 0
  1788. Compile options: <none>
  1789. Overall options: anchored
  1790. Starting code units: ! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^
  1791. _ ` { | } ~
  1792. Subject length lower bound = 1
  1793. /^[[:space:]]/IB
  1794. ------------------------------------------------------------------
  1795. Bra
  1796. ^
  1797. [\x09-\x0d ]
  1798. Ket
  1799. End
  1800. ------------------------------------------------------------------
  1801. Capture group count = 0
  1802. Compile options: <none>
  1803. Overall options: anchored
  1804. Starting code units: \x09 \x0a \x0b \x0c \x0d \x20
  1805. Subject length lower bound = 1
  1806. /^[[:upper:]]/IB
  1807. ------------------------------------------------------------------
  1808. Bra
  1809. ^
  1810. [A-Z]
  1811. Ket
  1812. End
  1813. ------------------------------------------------------------------
  1814. Capture group count = 0
  1815. Compile options: <none>
  1816. Overall options: anchored
  1817. Starting code units: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
  1818. Subject length lower bound = 1
  1819. /^[[:xdigit:]]/IB
  1820. ------------------------------------------------------------------
  1821. Bra
  1822. ^
  1823. [0-9A-Fa-f]
  1824. Ket
  1825. End
  1826. ------------------------------------------------------------------
  1827. Capture group count = 0
  1828. Compile options: <none>
  1829. Overall options: anchored
  1830. Starting code units: 0 1 2 3 4 5 6 7 8 9 A B C D E F a b c d e f
  1831. Subject length lower bound = 1
  1832. /^[[:word:]]/IB
  1833. ------------------------------------------------------------------
  1834. Bra
  1835. ^
  1836. [0-9A-Z_a-z]
  1837. Ket
  1838. End
  1839. ------------------------------------------------------------------
  1840. Capture group count = 0
  1841. Compile options: <none>
  1842. Overall options: anchored
  1843. Starting code units: 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P
  1844. Q R S T U V W X Y Z _ a b c d e f g h i j k l m n o p q r s t u v w x y z
  1845. Subject length lower bound = 1
  1846. /^[[:^cntrl:]]/IB
  1847. ------------------------------------------------------------------
  1848. Bra
  1849. ^
  1850. [ -~\x80-\xff] (neg)
  1851. Ket
  1852. End
  1853. ------------------------------------------------------------------
  1854. Capture group count = 0
  1855. Compile options: <none>
  1856. Overall options: anchored
  1857. Starting code units: \x20 ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8
  1858. 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ]
  1859. ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~ \x80 \x81
  1860. \x82 \x83 \x84 \x85 \x86 \x87 \x88 \x89 \x8a \x8b \x8c \x8d \x8e \x8f \x90
  1861. \x91 \x92 \x93 \x94 \x95 \x96 \x97 \x98 \x99 \x9a \x9b \x9c \x9d \x9e \x9f
  1862. \xa0 \xa1 \xa2 \xa3 \xa4 \xa5 \xa6 \xa7 \xa8 \xa9 \xaa \xab \xac \xad \xae
  1863. \xaf \xb0 \xb1 \xb2 \xb3 \xb4 \xb5 \xb6 \xb7 \xb8 \xb9 \xba \xbb \xbc \xbd
  1864. \xbe \xbf \xc0 \xc1 \xc2 \xc3 \xc4 \xc5 \xc6 \xc7 \xc8 \xc9 \xca \xcb \xcc
  1865. \xcd \xce \xcf \xd0 \xd1 \xd2 \xd3 \xd4 \xd5 \xd6 \xd7 \xd8 \xd9 \xda \xdb
  1866. \xdc \xdd \xde \xdf \xe0 \xe1 \xe2 \xe3 \xe4 \xe5 \xe6 \xe7 \xe8 \xe9 \xea
  1867. \xeb \xec \xed \xee \xef \xf0 \xf1 \xf2 \xf3 \xf4 \xf5 \xf6 \xf7 \xf8 \xf9
  1868. \xfa \xfb \xfc \xfd \xfe \xff
  1869. Subject length lower bound = 1
  1870. /^[12[:^digit:]]/IB
  1871. ------------------------------------------------------------------
  1872. Bra
  1873. ^
  1874. [\x00-/12:-\xff] (neg)
  1875. Ket
  1876. End
  1877. ------------------------------------------------------------------
  1878. Capture group count = 0
  1879. Compile options: <none>
  1880. Overall options: anchored
  1881. Starting code units: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x09 \x0a
  1882. \x0b \x0c \x0d \x0e \x0f \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19
  1883. \x1a \x1b \x1c \x1d \x1e \x1f \x20 ! " # $ % & ' ( ) * + , - . / 1 2 : ; <
  1884. = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a
  1885. b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~ \x7f \x80 \x81 \x82
  1886. \x83 \x84 \x85 \x86 \x87 \x88 \x89 \x8a \x8b \x8c \x8d \x8e \x8f \x90 \x91
  1887. \x92 \x93 \x94 \x95 \x96 \x97 \x98 \x99 \x9a \x9b \x9c \x9d \x9e \x9f \xa0
  1888. \xa1 \xa2 \xa3 \xa4 \xa5 \xa6 \xa7 \xa8 \xa9 \xaa \xab \xac \xad \xae \xaf
  1889. \xb0 \xb1 \xb2 \xb3 \xb4 \xb5 \xb6 \xb7 \xb8 \xb9 \xba \xbb \xbc \xbd \xbe
  1890. \xbf \xc0 \xc1 \xc2 \xc3 \xc4 \xc5 \xc6 \xc7 \xc8 \xc9 \xca \xcb \xcc \xcd
  1891. \xce \xcf \xd0 \xd1 \xd2 \xd3 \xd4 \xd5 \xd6 \xd7 \xd8 \xd9 \xda \xdb \xdc
  1892. \xdd \xde \xdf \xe0 \xe1 \xe2 \xe3 \xe4 \xe5 \xe6 \xe7 \xe8 \xe9 \xea \xeb
  1893. \xec \xed \xee \xef \xf0 \xf1 \xf2 \xf3 \xf4 \xf5 \xf6 \xf7 \xf8 \xf9 \xfa
  1894. \xfb \xfc \xfd \xfe \xff
  1895. Subject length lower bound = 1
  1896. /^[[:^blank:]]/IB
  1897. ------------------------------------------------------------------
  1898. Bra
  1899. ^
  1900. [\x00-\x08\x0a-\x1f!-\xff] (neg)
  1901. Ket
  1902. End
  1903. ------------------------------------------------------------------
  1904. Capture group count = 0
  1905. Compile options: <none>
  1906. Overall options: anchored
  1907. Starting code units: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x0a \x0b
  1908. \x0c \x0d \x0e \x0f \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19 \x1a
  1909. \x1b \x1c \x1d \x1e \x1f ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9
  1910. : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^
  1911. _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~ \x7f \x80
  1912. \x81 \x82 \x83 \x84 \x85 \x86 \x87 \x88 \x89 \x8a \x8b \x8c \x8d \x8e \x8f
  1913. \x90 \x91 \x92 \x93 \x94 \x95 \x96 \x97 \x98 \x99 \x9a \x9b \x9c \x9d \x9e
  1914. \x9f \xa0 \xa1 \xa2 \xa3 \xa4 \xa5 \xa6 \xa7 \xa8 \xa9 \xaa \xab \xac \xad
  1915. \xae \xaf \xb0 \xb1 \xb2 \xb3 \xb4 \xb5 \xb6 \xb7 \xb8 \xb9 \xba \xbb \xbc
  1916. \xbd \xbe \xbf \xc0 \xc1 \xc2 \xc3 \xc4 \xc5 \xc6 \xc7 \xc8 \xc9 \xca \xcb
  1917. \xcc \xcd \xce \xcf \xd0 \xd1 \xd2 \xd3 \xd4 \xd5 \xd6 \xd7 \xd8 \xd9 \xda
  1918. \xdb \xdc \xdd \xde \xdf \xe0 \xe1 \xe2 \xe3 \xe4 \xe5 \xe6 \xe7 \xe8 \xe9
  1919. \xea \xeb \xec \xed \xee \xef \xf0 \xf1 \xf2 \xf3 \xf4 \xf5 \xf6 \xf7 \xf8
  1920. \xf9 \xfa \xfb \xfc \xfd \xfe \xff
  1921. Subject length lower bound = 1
  1922. /[01[:alpha:]%]/IB
  1923. ------------------------------------------------------------------
  1924. Bra
  1925. [%01A-Za-z]
  1926. Ket
  1927. End
  1928. ------------------------------------------------------------------
  1929. Capture group count = 0
  1930. Starting code units: % 0 1 A B C D E F G H I J K L M N O P Q R S T U V W
  1931. X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z
  1932. Subject length lower bound = 1
  1933. /[[.ch.]]/I
  1934. Failed: error 113 at offset 1: POSIX collating elements are not supported
  1935. /[[=ch=]]/I
  1936. Failed: error 113 at offset 1: POSIX collating elements are not supported
  1937. /[[:rhubarb:]]/I
  1938. Failed: error 130 at offset 3: unknown POSIX class name
  1939. /[[:upper:]]/Ii
  1940. Capture group count = 0
  1941. Options: caseless
  1942. Starting code units: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
  1943. a b c d e f g h i j k l m n o p q r s t u v w x y z
  1944. Subject length lower bound = 1
  1945. A
  1946. 0: A
  1947. a
  1948. 0: a
  1949. /[[:lower:]]/Ii
  1950. Capture group count = 0
  1951. Options: caseless
  1952. Starting code units: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
  1953. a b c d e f g h i j k l m n o p q r s t u v w x y z
  1954. Subject length lower bound = 1
  1955. A
  1956. 0: A
  1957. a
  1958. 0: a
  1959. /((?-i)[[:lower:]])[[:lower:]]/Ii
  1960. Capture group count = 1
  1961. Options: caseless
  1962. Starting code units: a b c d e f g h i j k l m n o p q r s t u v w x y z
  1963. Subject length lower bound = 2
  1964. ab
  1965. 0: ab
  1966. 1: a
  1967. aB
  1968. 0: aB
  1969. 1: a
  1970. \= Expect no match
  1971. Ab
  1972. No match
  1973. AB
  1974. No match
  1975. /[\200-\110]/I
  1976. Failed: error 108 at offset 9: range out of order in character class
  1977. /^(?(0)f|b)oo/I
  1978. Failed: error 115 at offset 5: reference to non-existent subpattern
  1979. # This one's here because of the large output vector needed
  1980. /(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\w+)\s+(\270)/I
  1981. Capture group count = 271
  1982. Max back reference = 270
  1983. Starting code units: 0 1 2 3 4 5 6 7 8 9
  1984. Subject length lower bound = 1
  1985. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 ABC ABC\=ovector=300
  1986. 0: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 ABC ABC
  1987. 1: 1
  1988. 2: 2
  1989. 3: 3
  1990. 4: 4
  1991. 5: 5
  1992. 6: 6
  1993. 7: 7
  1994. 8: 8
  1995. 9: 9
  1996. 10: 10
  1997. 11: 11
  1998. 12: 12
  1999. 13: 13
  2000. 14: 14
  2001. 15: 15
  2002. 16: 16
  2003. 17: 17
  2004. 18: 18
  2005. 19: 19
  2006. 20: 20
  2007. 21: 21
  2008. 22: 22
  2009. 23: 23
  2010. 24: 24
  2011. 25: 25
  2012. 26: 26
  2013. 27: 27
  2014. 28: 28
  2015. 29: 29
  2016. 30: 30
  2017. 31: 31
  2018. 32: 32
  2019. 33: 33
  2020. 34: 34
  2021. 35: 35
  2022. 36: 36
  2023. 37: 37
  2024. 38: 38
  2025. 39: 39
  2026. 40: 40
  2027. 41: 41
  2028. 42: 42
  2029. 43: 43
  2030. 44: 44
  2031. 45: 45
  2032. 46: 46
  2033. 47: 47
  2034. 48: 48
  2035. 49: 49
  2036. 50: 50
  2037. 51: 51
  2038. 52: 52
  2039. 53: 53
  2040. 54: 54
  2041. 55: 55
  2042. 56: 56
  2043. 57: 57
  2044. 58: 58
  2045. 59: 59
  2046. 60: 60
  2047. 61: 61
  2048. 62: 62
  2049. 63: 63
  2050. 64: 64
  2051. 65: 65
  2052. 66: 66
  2053. 67: 67
  2054. 68: 68
  2055. 69: 69
  2056. 70: 70
  2057. 71: 71
  2058. 72: 72
  2059. 73: 73
  2060. 74: 74
  2061. 75: 75
  2062. 76: 76
  2063. 77: 77
  2064. 78: 78
  2065. 79: 79
  2066. 80: 80
  2067. 81: 81
  2068. 82: 82
  2069. 83: 83
  2070. 84: 84
  2071. 85: 85
  2072. 86: 86
  2073. 87: 87
  2074. 88: 88
  2075. 89: 89
  2076. 90: 90
  2077. 91: 91
  2078. 92: 92
  2079. 93: 93
  2080. 94: 94
  2081. 95: 95
  2082. 96: 96
  2083. 97: 97
  2084. 98: 98
  2085. 99: 99
  2086. 100: 100
  2087. 101: 101
  2088. 102: 102
  2089. 103: 103
  2090. 104: 104
  2091. 105: 105
  2092. 106: 106
  2093. 107: 107
  2094. 108: 108
  2095. 109: 109
  2096. 110: 110
  2097. 111: 111
  2098. 112: 112
  2099. 113: 113
  2100. 114: 114
  2101. 115: 115
  2102. 116: 116
  2103. 117: 117
  2104. 118: 118
  2105. 119: 119
  2106. 120: 120
  2107. 121: 121
  2108. 122: 122
  2109. 123: 123
  2110. 124: 124
  2111. 125: 125
  2112. 126: 126
  2113. 127: 127
  2114. 128: 128
  2115. 129: 129
  2116. 130: 130
  2117. 131: 131
  2118. 132: 132
  2119. 133: 133
  2120. 134: 134
  2121. 135: 135
  2122. 136: 136
  2123. 137: 137
  2124. 138: 138
  2125. 139: 139
  2126. 140: 140
  2127. 141: 141
  2128. 142: 142
  2129. 143: 143
  2130. 144: 144
  2131. 145: 145
  2132. 146: 146
  2133. 147: 147
  2134. 148: 148
  2135. 149: 149
  2136. 150: 150
  2137. 151: 151
  2138. 152: 152
  2139. 153: 153
  2140. 154: 154
  2141. 155: 155
  2142. 156: 156
  2143. 157: 157
  2144. 158: 158
  2145. 159: 159
  2146. 160: 160
  2147. 161: 161
  2148. 162: 162
  2149. 163: 163
  2150. 164: 164
  2151. 165: 165
  2152. 166: 166
  2153. 167: 167
  2154. 168: 168
  2155. 169: 169
  2156. 170: 170
  2157. 171: 171
  2158. 172: 172
  2159. 173: 173
  2160. 174: 174
  2161. 175: 175
  2162. 176: 176
  2163. 177: 177
  2164. 178: 178
  2165. 179: 179
  2166. 180: 180
  2167. 181: 181
  2168. 182: 182
  2169. 183: 183
  2170. 184: 184
  2171. 185: 185
  2172. 186: 186
  2173. 187: 187
  2174. 188: 188
  2175. 189: 189
  2176. 190: 190
  2177. 191: 191
  2178. 192: 192
  2179. 193: 193
  2180. 194: 194
  2181. 195: 195
  2182. 196: 196
  2183. 197: 197
  2184. 198: 198
  2185. 199: 199
  2186. 200: 200
  2187. 201: 201
  2188. 202: 202
  2189. 203: 203
  2190. 204: 204
  2191. 205: 205
  2192. 206: 206
  2193. 207: 207
  2194. 208: 208
  2195. 209: 209
  2196. 210: 210
  2197. 211: 211
  2198. 212: 212
  2199. 213: 213
  2200. 214: 214
  2201. 215: 215
  2202. 216: 216
  2203. 217: 217
  2204. 218: 218
  2205. 219: 219
  2206. 220: 220
  2207. 221: 221
  2208. 222: 222
  2209. 223: 223
  2210. 224: 224
  2211. 225: 225
  2212. 226: 226
  2213. 227: 227
  2214. 228: 228
  2215. 229: 229
  2216. 230: 230
  2217. 231: 231
  2218. 232: 232
  2219. 233: 233
  2220. 234: 234
  2221. 235: 235
  2222. 236: 236
  2223. 237: 237
  2224. 238: 238
  2225. 239: 239
  2226. 240: 240
  2227. 241: 241
  2228. 242: 242
  2229. 243: 243
  2230. 244: 244
  2231. 245: 245
  2232. 246: 246
  2233. 247: 247
  2234. 248: 248
  2235. 249: 249
  2236. 250: 250
  2237. 251: 251
  2238. 252: 252
  2239. 253: 253
  2240. 254: 254
  2241. 255: 255
  2242. 256: 256
  2243. 257: 257
  2244. 258: 258
  2245. 259: 259
  2246. 260: 260
  2247. 261: 261
  2248. 262: 262
  2249. 263: 263
  2250. 264: 264
  2251. 265: 265
  2252. 266: 266
  2253. 267: 267
  2254. 268: 268
  2255. 269: 269
  2256. 270: ABC
  2257. 271: ABC
  2258. # This one's here because Perl does this differently and PCRE2 can't at present
  2259. /(main(O)?)+/I
  2260. Capture group count = 2
  2261. First code unit = 'm'
  2262. Last code unit = 'n'
  2263. Subject length lower bound = 4
  2264. mainmain
  2265. 0: mainmain
  2266. 1: main
  2267. mainOmain
  2268. 0: mainOmain
  2269. 1: main
  2270. 2: O
  2271. # These are all cases where Perl does it differently (nested captures)
  2272. /^(a(b)?)+$/I
  2273. Capture group count = 2
  2274. Compile options: <none>
  2275. Overall options: anchored
  2276. First code unit = 'a'
  2277. Subject length lower bound = 1
  2278. aba
  2279. 0: aba
  2280. 1: a
  2281. 2: b
  2282. /^(aa(bb)?)+$/I
  2283. Capture group count = 2
  2284. Compile options: <none>
  2285. Overall options: anchored
  2286. First code unit = 'a'
  2287. Subject length lower bound = 2
  2288. aabbaa
  2289. 0: aabbaa
  2290. 1: aa
  2291. 2: bb
  2292. /^(aa|aa(bb))+$/I
  2293. Capture group count = 2
  2294. Compile options: <none>
  2295. Overall options: anchored
  2296. First code unit = 'a'
  2297. Subject length lower bound = 2
  2298. aabbaa
  2299. 0: aabbaa
  2300. 1: aa
  2301. 2: bb
  2302. /^(aa(bb)??)+$/I
  2303. Capture group count = 2
  2304. Compile options: <none>
  2305. Overall options: anchored
  2306. First code unit = 'a'
  2307. Subject length lower bound = 2
  2308. aabbaa
  2309. 0: aabbaa
  2310. 1: aa
  2311. 2: bb
  2312. /^(?:aa(bb)?)+$/I
  2313. Capture group count = 1
  2314. Compile options: <none>
  2315. Overall options: anchored
  2316. First code unit = 'a'
  2317. Subject length lower bound = 2
  2318. aabbaa
  2319. 0: aabbaa
  2320. 1: bb
  2321. /^(aa(b(b))?)+$/I
  2322. Capture group count = 3
  2323. Compile options: <none>
  2324. Overall options: anchored
  2325. First code unit = 'a'
  2326. Subject length lower bound = 2
  2327. aabbaa
  2328. 0: aabbaa
  2329. 1: aa
  2330. 2: bb
  2331. 3: b
  2332. /^(?:aa(b(b))?)+$/I
  2333. Capture group count = 2
  2334. Compile options: <none>
  2335. Overall options: anchored
  2336. First code unit = 'a'
  2337. Subject length lower bound = 2
  2338. aabbaa
  2339. 0: aabbaa
  2340. 1: bb
  2341. 2: b
  2342. /^(?:aa(b(?:b))?)+$/I
  2343. Capture group count = 1
  2344. Compile options: <none>
  2345. Overall options: anchored
  2346. First code unit = 'a'
  2347. Subject length lower bound = 2
  2348. aabbaa
  2349. 0: aabbaa
  2350. 1: bb
  2351. /^(?:aa(bb(?:b))?)+$/I
  2352. Capture group count = 1
  2353. Compile options: <none>
  2354. Overall options: anchored
  2355. First code unit = 'a'
  2356. Subject length lower bound = 2
  2357. aabbbaa
  2358. 0: aabbbaa
  2359. 1: bbb
  2360. /^(?:aa(b(?:bb))?)+$/I
  2361. Capture group count = 1
  2362. Compile options: <none>
  2363. Overall options: anchored
  2364. First code unit = 'a'
  2365. Subject length lower bound = 2
  2366. aabbbaa
  2367. 0: aabbbaa
  2368. 1: bbb
  2369. /^(?:aa(?:b(b))?)+$/I
  2370. Capture group count = 1
  2371. Compile options: <none>
  2372. Overall options: anchored
  2373. First code unit = 'a'
  2374. Subject length lower bound = 2
  2375. aabbaa
  2376. 0: aabbaa
  2377. 1: b
  2378. /^(?:aa(?:b(bb))?)+$/I
  2379. Capture group count = 1
  2380. Compile options: <none>
  2381. Overall options: anchored
  2382. First code unit = 'a'
  2383. Subject length lower bound = 2
  2384. aabbbaa
  2385. 0: aabbbaa
  2386. 1: bb
  2387. /^(aa(b(bb))?)+$/I
  2388. Capture group count = 3
  2389. Compile options: <none>
  2390. Overall options: anchored
  2391. First code unit = 'a'
  2392. Subject length lower bound = 2
  2393. aabbbaa
  2394. 0: aabbbaa
  2395. 1: aa
  2396. 2: bbb
  2397. 3: bb
  2398. /^(aa(bb(bb))?)+$/I
  2399. Capture group count = 3
  2400. Compile options: <none>
  2401. Overall options: anchored
  2402. First code unit = 'a'
  2403. Subject length lower bound = 2
  2404. aabbbbaa
  2405. 0: aabbbbaa
  2406. 1: aa
  2407. 2: bbbb
  2408. 3: bb
  2409. # ----------------
  2410. /#/IBx
  2411. ------------------------------------------------------------------
  2412. Bra
  2413. Ket
  2414. End
  2415. ------------------------------------------------------------------
  2416. Capture group count = 0
  2417. May match empty string
  2418. Options: extended
  2419. Subject length lower bound = 0
  2420. /a#/IBx
  2421. ------------------------------------------------------------------
  2422. Bra
  2423. a
  2424. Ket
  2425. End
  2426. ------------------------------------------------------------------
  2427. Capture group count = 0
  2428. Options: extended
  2429. First code unit = 'a'
  2430. Subject length lower bound = 1
  2431. /[\s]/IB
  2432. ------------------------------------------------------------------
  2433. Bra
  2434. [\x09-\x0d ]
  2435. Ket
  2436. End
  2437. ------------------------------------------------------------------
  2438. Capture group count = 0
  2439. Starting code units: \x09 \x0a \x0b \x0c \x0d \x20
  2440. Subject length lower bound = 1
  2441. /[\S]/IB
  2442. ------------------------------------------------------------------
  2443. Bra
  2444. [\x00-\x08\x0e-\x1f!-\xff] (neg)
  2445. Ket
  2446. End
  2447. ------------------------------------------------------------------
  2448. Capture group count = 0
  2449. Starting code units: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x0e \x0f
  2450. \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19 \x1a \x1b \x1c \x1d \x1e
  2451. \x1f ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C
  2452. D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h
  2453. i j k l m n o p q r s t u v w x y z { | } ~ \x7f \x80 \x81 \x82 \x83 \x84
  2454. \x85 \x86 \x87 \x88 \x89 \x8a \x8b \x8c \x8d \x8e \x8f \x90 \x91 \x92 \x93
  2455. \x94 \x95 \x96 \x97 \x98 \x99 \x9a \x9b \x9c \x9d \x9e \x9f \xa0 \xa1 \xa2
  2456. \xa3 \xa4 \xa5 \xa6 \xa7 \xa8 \xa9 \xaa \xab \xac \xad \xae \xaf \xb0 \xb1
  2457. \xb2 \xb3 \xb4 \xb5 \xb6 \xb7 \xb8 \xb9 \xba \xbb \xbc \xbd \xbe \xbf \xc0
  2458. \xc1 \xc2 \xc3 \xc4 \xc5 \xc6 \xc7 \xc8 \xc9 \xca \xcb \xcc \xcd \xce \xcf
  2459. \xd0 \xd1 \xd2 \xd3 \xd4 \xd5 \xd6 \xd7 \xd8 \xd9 \xda \xdb \xdc \xdd \xde
  2460. \xdf \xe0 \xe1 \xe2 \xe3 \xe4 \xe5 \xe6 \xe7 \xe8 \xe9 \xea \xeb \xec \xed
  2461. \xee \xef \xf0 \xf1 \xf2 \xf3 \xf4 \xf5 \xf6 \xf7 \xf8 \xf9 \xfa \xfb \xfc
  2462. \xfd \xfe \xff
  2463. Subject length lower bound = 1
  2464. /a(?i)b/IB
  2465. ------------------------------------------------------------------
  2466. Bra
  2467. a
  2468. /i b
  2469. Ket
  2470. End
  2471. ------------------------------------------------------------------
  2472. Capture group count = 0
  2473. First code unit = 'a'
  2474. Last code unit = 'b' (caseless)
  2475. Subject length lower bound = 2
  2476. ab
  2477. 0: ab
  2478. aB
  2479. 0: aB
  2480. \= Expect no match
  2481. AB
  2482. No match
  2483. /(a(?i)b)/IB
  2484. ------------------------------------------------------------------
  2485. Bra
  2486. CBra 1
  2487. a
  2488. /i b
  2489. Ket
  2490. Ket
  2491. End
  2492. ------------------------------------------------------------------
  2493. Capture group count = 1
  2494. First code unit = 'a'
  2495. Last code unit = 'b' (caseless)
  2496. Subject length lower bound = 2
  2497. ab
  2498. 0: ab
  2499. 1: ab
  2500. aB
  2501. 0: aB
  2502. 1: aB
  2503. \= Expect no match
  2504. AB
  2505. No match
  2506. / (?i)abc/IBx
  2507. ------------------------------------------------------------------
  2508. Bra
  2509. /i abc
  2510. Ket
  2511. End
  2512. ------------------------------------------------------------------
  2513. Capture group count = 0
  2514. Options: extended
  2515. First code unit = 'a' (caseless)
  2516. Last code unit = 'c' (caseless)
  2517. Subject length lower bound = 3
  2518. /#this is a comment
  2519. (?i)abc/IBx
  2520. ------------------------------------------------------------------
  2521. Bra
  2522. /i abc
  2523. Ket
  2524. End
  2525. ------------------------------------------------------------------
  2526. Capture group count = 0
  2527. Options: extended
  2528. First code unit = 'a' (caseless)
  2529. Last code unit = 'c' (caseless)
  2530. Subject length lower bound = 3
  2531. /123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890/IB
  2532. ------------------------------------------------------------------
  2533. Bra
  2534. 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
  2535. Ket
  2536. End
  2537. ------------------------------------------------------------------
  2538. Capture group count = 0
  2539. First code unit = '1'
  2540. Last code unit = '0'
  2541. Subject length lower bound = 300
  2542. /\Q123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890/IB
  2543. ------------------------------------------------------------------
  2544. Bra
  2545. 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
  2546. Ket
  2547. End
  2548. ------------------------------------------------------------------
  2549. Capture group count = 0
  2550. First code unit = '1'
  2551. Last code unit = '0'
  2552. Subject length lower bound = 300
  2553. /\Q\E/IB
  2554. ------------------------------------------------------------------
  2555. Bra
  2556. Ket
  2557. End
  2558. ------------------------------------------------------------------
  2559. Capture group count = 0
  2560. May match empty string
  2561. Subject length lower bound = 0
  2562. \
  2563. 0:
  2564. /\Q\Ex/IB
  2565. ------------------------------------------------------------------
  2566. Bra
  2567. x
  2568. Ket
  2569. End
  2570. ------------------------------------------------------------------
  2571. Capture group count = 0
  2572. First code unit = 'x'
  2573. Subject length lower bound = 1
  2574. / \Q\E/IB
  2575. ------------------------------------------------------------------
  2576. Bra
  2577. Ket
  2578. End
  2579. ------------------------------------------------------------------
  2580. Capture group count = 0
  2581. First code unit = ' '
  2582. Subject length lower bound = 1
  2583. /a\Q\E/IB
  2584. ------------------------------------------------------------------
  2585. Bra
  2586. a
  2587. Ket
  2588. End
  2589. ------------------------------------------------------------------
  2590. Capture group count = 0
  2591. First code unit = 'a'
  2592. Subject length lower bound = 1
  2593. abc
  2594. 0: a
  2595. bca
  2596. 0: a
  2597. bac
  2598. 0: a
  2599. /a\Q\Eb/IB
  2600. ------------------------------------------------------------------
  2601. Bra
  2602. ab
  2603. Ket
  2604. End
  2605. ------------------------------------------------------------------
  2606. Capture group count = 0
  2607. First code unit = 'a'
  2608. Last code unit = 'b'
  2609. Subject length lower bound = 2
  2610. abc
  2611. 0: ab
  2612. /\Q\Eabc/IB
  2613. ------------------------------------------------------------------
  2614. Bra
  2615. abc
  2616. Ket
  2617. End
  2618. ------------------------------------------------------------------
  2619. Capture group count = 0
  2620. First code unit = 'a'
  2621. Last code unit = 'c'
  2622. Subject length lower bound = 3
  2623. /x*+\w/IB
  2624. ------------------------------------------------------------------
  2625. Bra
  2626. x*+
  2627. \w
  2628. Ket
  2629. End
  2630. ------------------------------------------------------------------
  2631. Capture group count = 0
  2632. Starting code units: 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P
  2633. Q R S T U V W X Y Z _ a b c d e f g h i j k l m n o p q r s t u v w x y z
  2634. Subject length lower bound = 1
  2635. \= Expect no match
  2636. xxxxx
  2637. No match
  2638. /x?+/IB
  2639. ------------------------------------------------------------------
  2640. Bra
  2641. x?+
  2642. Ket
  2643. End
  2644. ------------------------------------------------------------------
  2645. Capture group count = 0
  2646. May match empty string
  2647. Subject length lower bound = 0
  2648. /x++/IB
  2649. ------------------------------------------------------------------
  2650. Bra
  2651. x++
  2652. Ket
  2653. End
  2654. ------------------------------------------------------------------
  2655. Capture group count = 0
  2656. First code unit = 'x'
  2657. Subject length lower bound = 1
  2658. /x{1,3}+/B,no_auto_possess
  2659. ------------------------------------------------------------------
  2660. Bra
  2661. x
  2662. x{0,2}+
  2663. Ket
  2664. End
  2665. ------------------------------------------------------------------
  2666. /x{1,3}+/Bi,no_auto_possess
  2667. ------------------------------------------------------------------
  2668. Bra
  2669. /i x
  2670. /i x{0,2}+
  2671. Ket
  2672. End
  2673. ------------------------------------------------------------------
  2674. /[^x]{1,3}+/B,no_auto_possess
  2675. ------------------------------------------------------------------
  2676. Bra
  2677. [^x]
  2678. [^x]{0,2}+
  2679. Ket
  2680. End
  2681. ------------------------------------------------------------------
  2682. /[^x]{1,3}+/Bi,no_auto_possess
  2683. ------------------------------------------------------------------
  2684. Bra
  2685. /i [^x]
  2686. /i [^x]{0,2}+
  2687. Ket
  2688. End
  2689. ------------------------------------------------------------------
  2690. /(x)*+/IB
  2691. ------------------------------------------------------------------
  2692. Bra
  2693. Braposzero
  2694. CBraPos 1
  2695. x
  2696. KetRpos
  2697. Ket
  2698. End
  2699. ------------------------------------------------------------------
  2700. Capture group count = 1
  2701. May match empty string
  2702. Subject length lower bound = 0
  2703. /^(\w++|\s++)*$/I
  2704. Capture group count = 1
  2705. May match empty string
  2706. Compile options: <none>
  2707. Overall options: anchored
  2708. Subject length lower bound = 0
  2709. now is the time for all good men to come to the aid of the party
  2710. 0: now is the time for all good men to come to the aid of the party
  2711. 1: party
  2712. \= Expect no match
  2713. this is not a line with only words and spaces!
  2714. No match
  2715. /(\d++)(\w)/I
  2716. Capture group count = 2
  2717. Starting code units: 0 1 2 3 4 5 6 7 8 9
  2718. Subject length lower bound = 2
  2719. 12345a
  2720. 0: 12345a
  2721. 1: 12345
  2722. 2: a
  2723. \= Expect no match
  2724. 12345+
  2725. No match
  2726. /a++b/I
  2727. Capture group count = 0
  2728. First code unit = 'a'
  2729. Last code unit = 'b'
  2730. Subject length lower bound = 2
  2731. aaab
  2732. 0: aaab
  2733. /(a++b)/I
  2734. Capture group count = 1
  2735. First code unit = 'a'
  2736. Last code unit = 'b'
  2737. Subject length lower bound = 2
  2738. aaab
  2739. 0: aaab
  2740. 1: aaab
  2741. /(a++)b/I
  2742. Capture group count = 1
  2743. First code unit = 'a'
  2744. Last code unit = 'b'
  2745. Subject length lower bound = 2
  2746. aaab
  2747. 0: aaab
  2748. 1: aaa
  2749. /([^()]++|\([^()]*\))+/I
  2750. Capture group count = 1
  2751. Starting code units: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x09 \x0a
  2752. \x0b \x0c \x0d \x0e \x0f \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19
  2753. \x1a \x1b \x1c \x1d \x1e \x1f \x20 ! " # $ % & ' ( * + , - . / 0 1 2 3 4 5
  2754. 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
  2755. [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~ \x7f
  2756. \x80 \x81 \x82 \x83 \x84 \x85 \x86 \x87 \x88 \x89 \x8a \x8b \x8c \x8d \x8e
  2757. \x8f \x90 \x91 \x92 \x93 \x94 \x95 \x96 \x97 \x98 \x99 \x9a \x9b \x9c \x9d
  2758. \x9e \x9f \xa0 \xa1 \xa2 \xa3 \xa4 \xa5 \xa6 \xa7 \xa8 \xa9 \xaa \xab \xac
  2759. \xad \xae \xaf \xb0 \xb1 \xb2 \xb3 \xb4 \xb5 \xb6 \xb7 \xb8 \xb9 \xba \xbb
  2760. \xbc \xbd \xbe \xbf \xc0 \xc1 \xc2 \xc3 \xc4 \xc5 \xc6 \xc7 \xc8 \xc9 \xca
  2761. \xcb \xcc \xcd \xce \xcf \xd0 \xd1 \xd2 \xd3 \xd4 \xd5 \xd6 \xd7 \xd8 \xd9
  2762. \xda \xdb \xdc \xdd \xde \xdf \xe0 \xe1 \xe2 \xe3 \xe4 \xe5 \xe6 \xe7 \xe8
  2763. \xe9 \xea \xeb \xec \xed \xee \xef \xf0 \xf1 \xf2 \xf3 \xf4 \xf5 \xf6 \xf7
  2764. \xf8 \xf9 \xfa \xfb \xfc \xfd \xfe \xff
  2765. Subject length lower bound = 1
  2766. ((abc(ade)ufh()()x
  2767. 0: abc(ade)ufh()()x
  2768. 1: x
  2769. /\(([^()]++|\([^()]+\))+\)/I
  2770. Capture group count = 1
  2771. First code unit = '('
  2772. Last code unit = ')'
  2773. Subject length lower bound = 3
  2774. (abc)
  2775. 0: (abc)
  2776. 1: abc
  2777. (abc(def)xyz)
  2778. 0: (abc(def)xyz)
  2779. 1: xyz
  2780. \= Expect no match
  2781. ((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
  2782. No match
  2783. /(abc){1,3}+/IB
  2784. ------------------------------------------------------------------
  2785. Bra
  2786. Once
  2787. CBra 1
  2788. abc
  2789. Ket
  2790. Brazero
  2791. Bra
  2792. CBra 1
  2793. abc
  2794. Ket
  2795. Brazero
  2796. CBra 1
  2797. abc
  2798. Ket
  2799. Ket
  2800. Ket
  2801. Ket
  2802. End
  2803. ------------------------------------------------------------------
  2804. Capture group count = 1
  2805. First code unit = 'a'
  2806. Last code unit = 'c'
  2807. Subject length lower bound = 3
  2808. /a+?+/I
  2809. Failed: error 109 at offset 3: quantifier does not follow a repeatable item
  2810. /a{2,3}?+b/I
  2811. Failed: error 109 at offset 7: quantifier does not follow a repeatable item
  2812. /(?U)a+?+/I
  2813. Failed: error 109 at offset 7: quantifier does not follow a repeatable item
  2814. /a{2,3}?+b/I,ungreedy
  2815. Failed: error 109 at offset 7: quantifier does not follow a repeatable item
  2816. /x(?U)a++b/IB
  2817. ------------------------------------------------------------------
  2818. Bra
  2819. x
  2820. a++
  2821. b
  2822. Ket
  2823. End
  2824. ------------------------------------------------------------------
  2825. Capture group count = 0
  2826. First code unit = 'x'
  2827. Last code unit = 'b'
  2828. Subject length lower bound = 3
  2829. xaaaab
  2830. 0: xaaaab
  2831. /(?U)xa++b/IB
  2832. ------------------------------------------------------------------
  2833. Bra
  2834. x
  2835. a++
  2836. b
  2837. Ket
  2838. End
  2839. ------------------------------------------------------------------
  2840. Capture group count = 0
  2841. First code unit = 'x'
  2842. Last code unit = 'b'
  2843. Subject length lower bound = 3
  2844. xaaaab
  2845. 0: xaaaab
  2846. /^((a+)(?U)([ab]+)(?-U)([bc]+)(\w*))/IB
  2847. ------------------------------------------------------------------
  2848. Bra
  2849. ^
  2850. CBra 1
  2851. CBra 2
  2852. a+
  2853. Ket
  2854. CBra 3
  2855. [ab]+?
  2856. Ket
  2857. CBra 4
  2858. [bc]+
  2859. Ket
  2860. CBra 5
  2861. \w*+
  2862. Ket
  2863. Ket
  2864. Ket
  2865. End
  2866. ------------------------------------------------------------------
  2867. Capture group count = 5
  2868. Compile options: <none>
  2869. Overall options: anchored
  2870. First code unit = 'a'
  2871. Subject length lower bound = 3
  2872. /^x(?U)a+b/IB
  2873. ------------------------------------------------------------------
  2874. Bra
  2875. ^
  2876. x
  2877. a++
  2878. b
  2879. Ket
  2880. End
  2881. ------------------------------------------------------------------
  2882. Capture group count = 0
  2883. Compile options: <none>
  2884. Overall options: anchored
  2885. First code unit = 'x'
  2886. Last code unit = 'b'
  2887. Subject length lower bound = 3
  2888. /^x(?U)(a+)b/IB
  2889. ------------------------------------------------------------------
  2890. Bra
  2891. ^
  2892. x
  2893. CBra 1
  2894. a+?
  2895. Ket
  2896. b
  2897. Ket
  2898. End
  2899. ------------------------------------------------------------------
  2900. Capture group count = 1
  2901. Compile options: <none>
  2902. Overall options: anchored
  2903. First code unit = 'x'
  2904. Last code unit = 'b'
  2905. Subject length lower bound = 3
  2906. /[.x.]/I
  2907. Failed: error 113 at offset 0: POSIX collating elements are not supported
  2908. /[=x=]/I
  2909. Failed: error 113 at offset 0: POSIX collating elements are not supported
  2910. /[:x:]/I
  2911. Failed: error 112 at offset 0: POSIX named classes are supported only within a class
  2912. /\F/I
  2913. Failed: error 137 at offset 2: PCRE2 does not support \F, \L, \l, \N{name}, \U, or \u
  2914. /\l/I
  2915. Failed: error 137 at offset 2: PCRE2 does not support \F, \L, \l, \N{name}, \U, or \u
  2916. /\L/I
  2917. Failed: error 137 at offset 2: PCRE2 does not support \F, \L, \l, \N{name}, \U, or \u
  2918. /\N{name}/I
  2919. Failed: error 137 at offset 2: PCRE2 does not support \F, \L, \l, \N{name}, \U, or \u
  2920. /\u/I
  2921. Failed: error 137 at offset 2: PCRE2 does not support \F, \L, \l, \N{name}, \U, or \u
  2922. /\U/I
  2923. Failed: error 137 at offset 2: PCRE2 does not support \F, \L, \l, \N{name}, \U, or \u
  2924. /a{1,3}b/ungreedy
  2925. ab
  2926. 0: ab
  2927. /[/I
  2928. Failed: error 106 at offset 1: missing terminating ] for character class
  2929. /[a-/I
  2930. Failed: error 106 at offset 3: missing terminating ] for character class
  2931. /[[:space:]/I
  2932. Failed: error 106 at offset 10: missing terminating ] for character class
  2933. /[\s]/IB
  2934. ------------------------------------------------------------------
  2935. Bra
  2936. [\x09-\x0d ]
  2937. Ket
  2938. End
  2939. ------------------------------------------------------------------
  2940. Capture group count = 0
  2941. Starting code units: \x09 \x0a \x0b \x0c \x0d \x20
  2942. Subject length lower bound = 1
  2943. /[[:space:]]/IB
  2944. ------------------------------------------------------------------
  2945. Bra
  2946. [\x09-\x0d ]
  2947. Ket
  2948. End
  2949. ------------------------------------------------------------------
  2950. Capture group count = 0
  2951. Starting code units: \x09 \x0a \x0b \x0c \x0d \x20
  2952. Subject length lower bound = 1
  2953. /[[:space:]abcde]/IB
  2954. ------------------------------------------------------------------
  2955. Bra
  2956. [\x09-\x0d a-e]
  2957. Ket
  2958. End
  2959. ------------------------------------------------------------------
  2960. Capture group count = 0
  2961. Starting code units: \x09 \x0a \x0b \x0c \x0d \x20 a b c d e
  2962. Subject length lower bound = 1
  2963. /< (?: (?(R) \d++ | [^<>]*+) | (?R)) * >/Ix
  2964. Capture group count = 0
  2965. Options: extended
  2966. First code unit = '<'
  2967. Last code unit = '>'
  2968. Subject length lower bound = 2
  2969. <>
  2970. 0: <>
  2971. <abcd>
  2972. 0: <abcd>
  2973. <abc <123> hij>
  2974. 0: <abc <123> hij>
  2975. <abc <def> hij>
  2976. 0: <def>
  2977. <abc<>def>
  2978. 0: <abc<>def>
  2979. <abc<>
  2980. 0: <>
  2981. \= Expect no match
  2982. <abc
  2983. No match
  2984. /8J\$WE\<\.rX\+ix\[d1b\!H\#\?vV0vrK\:ZH1\=2M\>iV\;\?aPhFB\<\*vW\@QW\@sO9\}cfZA\-i\'w\%hKd6gt1UJP\,15_\#QY\$M\^Mss_U\/\]\&LK9\[5vQub\^w\[KDD\<EjmhUZ\?\.akp2dF\>qmj\;2\}YWFdYx\.Ap\]hjCPTP\(n28k\+3\;o\&WXqs\/gOXdr\$\:r\'do0\;b4c\(f_Gr\=\"\\4\)\[01T7ajQJvL\$W\~mL_sS\/4h\:x\*\[ZN\=KLs\&L5zX\/\/\>it\,o\:aU\(\;Z\>pW\&T7oP\'2K\^E\:x9\'c\[\%z\-\,64JQ5AeH_G\#KijUKghQw\^\\vea3a\?kka_G\$8\#\`\*kynsxzBLru\'\]k_\[7FrVx\}\^\=\$blx\>s\-N\%j\;D\*aZDnsw\:YKZ\%Q\.Kne9\#hP\?\+b3\(SOvL\,\^\;\&u5\@\?5C5Bhb\=m\-vEh_L15Jl\]U\)0RP6\{q\%L\^_z5E\'Dw6X\b/IB
  2985. ------------------------------------------------------------------
  2986. Bra
  2987. 8J$WE<.rX+ix[d1b!H#?vV0vrK:ZH1=2M>iV;?aPhFB<*vW@QW@sO9}cfZA-i'w%hKd6gt1UJP,15_#QY$M^Mss_U/]&LK9[5vQub^w[KDD<EjmhUZ?.akp2dF>qmj;2}YWFdYx.Ap]hjCPTP(n28k+3;o&WXqs/gOXdr$:r'do0;b4c(f_Gr="\4)[01T7ajQJvL$W~mL_sS/4h:x*[ZN=KLs&L5zX//>it,o:aU(;Z>pW&T7oP'2K^E:x9'c[%z-,64JQ5AeH_G#KijUKghQw^\vea3a?kka_G$8#`*kynsxzBLru']k_[7FrVx}^=$blx>s-N%j;D*aZDnsw:YKZ%Q.Kne9#hP?+b3(SOvL,^;&u5@?5C5Bhb=m-vEh_L15Jl]U)0RP6{q%L^_z5E'Dw6X
  2988. \b
  2989. Ket
  2990. End
  2991. ------------------------------------------------------------------
  2992. Capture group count = 0
  2993. Max lookbehind = 1
  2994. First code unit = '8'
  2995. Last code unit = 'X'
  2996. Subject length lower bound = 409
  2997. /\$\<\.X\+ix\[d1b\!H\#\?vV0vrK\:ZH1\=2M\>iV\;\?aPhFB\<\*vW\@QW\@sO9\}cfZA\-i\'w\%hKd6gt1UJP\,15_\#QY\$M\^Mss_U\/\]\&LK9\[5vQub\^w\[KDD\<EjmhUZ\?\.akp2dF\>qmj\;2\}YWFdYx\.Ap\]hjCPTP\(n28k\+3\;o\&WXqs\/gOXdr\$\:r\'do0\;b4c\(f_Gr\=\"\\4\)\[01T7ajQJvL\$W\~mL_sS\/4h\:x\*\[ZN\=KLs\&L5zX\/\/\>it\,o\:aU\(\;Z\>pW\&T7oP\'2K\^E\:x9\'c\[\%z\-\,64JQ5AeH_G\#KijUKghQw\^\\vea3a\?kka_G\$8\#\`\*kynsxzBLru\'\]k_\[7FrVx\}\^\=\$blx\>s\-N\%j\;D\*aZDnsw\:YKZ\%Q\.Kne9\#hP\?\+b3\(SOvL\,\^\;\&u5\@\?5C5Bhb\=m\-vEh_L15Jl\]U\)0RP6\{q\%L\^_z5E\'Dw6X\b/IB
  2998. ------------------------------------------------------------------
  2999. Bra
  3000. $<.X+ix[d1b!H#?vV0vrK:ZH1=2M>iV;?aPhFB<*vW@QW@sO9}cfZA-i'w%hKd6gt1UJP,15_#QY$M^Mss_U/]&LK9[5vQub^w[KDD<EjmhUZ?.akp2dF>qmj;2}YWFdYx.Ap]hjCPTP(n28k+3;o&WXqs/gOXdr$:r'do0;b4c(f_Gr="\4)[01T7ajQJvL$W~mL_sS/4h:x*[ZN=KLs&L5zX//>it,o:aU(;Z>pW&T7oP'2K^E:x9'c[%z-,64JQ5AeH_G#KijUKghQw^\vea3a?kka_G$8#`*kynsxzBLru']k_[7FrVx}^=$blx>s-N%j;D*aZDnsw:YKZ%Q.Kne9#hP?+b3(SOvL,^;&u5@?5C5Bhb=m-vEh_L15Jl]U)0RP6{q%L^_z5E'Dw6X
  3001. \b
  3002. Ket
  3003. End
  3004. ------------------------------------------------------------------
  3005. Capture group count = 0
  3006. Max lookbehind = 1
  3007. First code unit = '$'
  3008. Last code unit = 'X'
  3009. Subject length lower bound = 404
  3010. /(.*)\d+\1/I
  3011. Capture group count = 1
  3012. Max back reference = 1
  3013. Subject length lower bound = 1
  3014. /(.*)\d+/I
  3015. Capture group count = 1
  3016. First code unit at start or follows newline
  3017. Subject length lower bound = 1
  3018. /(.*)\d+\1/Is
  3019. Capture group count = 1
  3020. Max back reference = 1
  3021. Options: dotall
  3022. Subject length lower bound = 1
  3023. /(.*)\d+/Is
  3024. Capture group count = 1
  3025. Compile options: dotall
  3026. Overall options: anchored dotall
  3027. Subject length lower bound = 1
  3028. /(.*(xyz))\d+\2/I
  3029. Capture group count = 2
  3030. Max back reference = 2
  3031. First code unit at start or follows newline
  3032. Last code unit = 'z'
  3033. Subject length lower bound = 7
  3034. /((.*))\d+\1/I
  3035. Capture group count = 2
  3036. Max back reference = 1
  3037. Subject length lower bound = 1
  3038. abc123bc
  3039. 0: bc123bc
  3040. 1: bc
  3041. 2: bc
  3042. /a[b]/I
  3043. Capture group count = 0
  3044. First code unit = 'a'
  3045. Last code unit = 'b'
  3046. Subject length lower bound = 2
  3047. /(?=a).*/I
  3048. Capture group count = 0
  3049. May match empty string
  3050. First code unit = 'a'
  3051. Subject length lower bound = 1
  3052. /(?=abc).xyz/Ii
  3053. Capture group count = 0
  3054. Options: caseless
  3055. First code unit = 'a' (caseless)
  3056. Last code unit = 'z' (caseless)
  3057. Subject length lower bound = 4
  3058. /(?=abc)(?i).xyz/I
  3059. Capture group count = 0
  3060. First code unit = 'a'
  3061. Last code unit = 'z' (caseless)
  3062. Subject length lower bound = 4
  3063. /(?=a)(?=b)/I
  3064. Capture group count = 0
  3065. May match empty string
  3066. First code unit = 'a'
  3067. Subject length lower bound = 1
  3068. /(?=.)a/I
  3069. Capture group count = 0
  3070. First code unit = 'a'
  3071. Subject length lower bound = 1
  3072. /((?=abcda)a)/I
  3073. Capture group count = 1
  3074. First code unit = 'a'
  3075. Last code unit = 'a'
  3076. Subject length lower bound = 2
  3077. /((?=abcda)ab)/I
  3078. Capture group count = 1
  3079. First code unit = 'a'
  3080. Last code unit = 'b'
  3081. Subject length lower bound = 2
  3082. /()a/I
  3083. Capture group count = 1
  3084. First code unit = 'a'
  3085. Subject length lower bound = 1
  3086. /(?:(?=.)|(?<!x))a/I
  3087. Capture group count = 0
  3088. Max lookbehind = 1
  3089. First code unit = 'a'
  3090. Subject length lower bound = 1
  3091. /(?(1)ab|ac)(.)/I
  3092. Capture group count = 1
  3093. Max back reference = 1
  3094. First code unit = 'a'
  3095. Subject length lower bound = 3
  3096. /(?(1)abz|acz)(.)/I
  3097. Capture group count = 1
  3098. Max back reference = 1
  3099. First code unit = 'a'
  3100. Last code unit = 'z'
  3101. Subject length lower bound = 4
  3102. /(?(1)abz)(.)/I
  3103. Capture group count = 1
  3104. Max back reference = 1
  3105. Subject length lower bound = 1
  3106. /(?(1)abz)(1)23/I
  3107. Capture group count = 1
  3108. Max back reference = 1
  3109. Last code unit = '3'
  3110. Subject length lower bound = 3
  3111. /(a)+/I
  3112. Capture group count = 1
  3113. First code unit = 'a'
  3114. Subject length lower bound = 1
  3115. /(a){2,3}/I
  3116. Capture group count = 1
  3117. First code unit = 'a'
  3118. Last code unit = 'a'
  3119. Subject length lower bound = 2
  3120. /(a)*/I
  3121. Capture group count = 1
  3122. May match empty string
  3123. Subject length lower bound = 0
  3124. /[a]/I
  3125. Capture group count = 0
  3126. First code unit = 'a'
  3127. Subject length lower bound = 1
  3128. /[ab]/I
  3129. Capture group count = 0
  3130. Starting code units: a b
  3131. Subject length lower bound = 1
  3132. /[ab]/I
  3133. Capture group count = 0
  3134. Starting code units: a b
  3135. Subject length lower bound = 1
  3136. /[^a]/I
  3137. Capture group count = 0
  3138. Subject length lower bound = 1
  3139. /\d456/I
  3140. Capture group count = 0
  3141. Starting code units: 0 1 2 3 4 5 6 7 8 9
  3142. Last code unit = '6'
  3143. Subject length lower bound = 4
  3144. /\d456/I
  3145. Capture group count = 0
  3146. Starting code units: 0 1 2 3 4 5 6 7 8 9
  3147. Last code unit = '6'
  3148. Subject length lower bound = 4
  3149. /a^b/I
  3150. Capture group count = 0
  3151. First code unit = 'a'
  3152. Last code unit = 'b'
  3153. Subject length lower bound = 2
  3154. /^a/Im
  3155. Capture group count = 0
  3156. Options: multiline
  3157. First code unit at start or follows newline
  3158. Last code unit = 'a'
  3159. Subject length lower bound = 1
  3160. abcde
  3161. 0: a
  3162. xy\nabc
  3163. 0: a
  3164. \= Expect no match
  3165. xyabc
  3166. No match
  3167. /c|abc/I
  3168. Capture group count = 0
  3169. Starting code units: a c
  3170. Last code unit = 'c'
  3171. Subject length lower bound = 1
  3172. /(?i)[ab]/I
  3173. Capture group count = 0
  3174. Starting code units: A B a b
  3175. Subject length lower bound = 1
  3176. /[ab](?i)cd/I
  3177. Capture group count = 0
  3178. Starting code units: a b
  3179. Last code unit = 'd' (caseless)
  3180. Subject length lower bound = 3
  3181. /abc(?C)def/I
  3182. Capture group count = 0
  3183. First code unit = 'a'
  3184. Last code unit = 'f'
  3185. Subject length lower bound = 6
  3186. abcdef
  3187. --->abcdef
  3188. 0 ^ ^ d
  3189. 0: abcdef
  3190. 1234abcdef
  3191. --->1234abcdef
  3192. 0 ^ ^ d
  3193. 0: abcdef
  3194. \= Expect no match
  3195. abcxyz
  3196. No match
  3197. abcxyzf
  3198. --->abcxyzf
  3199. 0 ^ ^ d
  3200. No match
  3201. /abc(?C)de(?C1)f/I
  3202. Capture group count = 0
  3203. First code unit = 'a'
  3204. Last code unit = 'f'
  3205. Subject length lower bound = 6
  3206. 123abcdef
  3207. --->123abcdef
  3208. 0 ^ ^ d
  3209. 1 ^ ^ f
  3210. 0: abcdef
  3211. /(?C1)\dabc(?C2)def/I
  3212. Capture group count = 0
  3213. Starting code units: 0 1 2 3 4 5 6 7 8 9
  3214. Last code unit = 'f'
  3215. Subject length lower bound = 7
  3216. 1234abcdef
  3217. --->1234abcdef
  3218. 1 ^ \d
  3219. 1 ^ \d
  3220. 1 ^ \d
  3221. 1 ^ \d
  3222. 2 ^ ^ d
  3223. 0: 4abcdef
  3224. \= Expect no match
  3225. abcdef
  3226. No match
  3227. /(?C1)\dabc(?C2)def/I
  3228. Capture group count = 0
  3229. Starting code units: 0 1 2 3 4 5 6 7 8 9
  3230. Last code unit = 'f'
  3231. Subject length lower bound = 7
  3232. 1234abcdef
  3233. --->1234abcdef
  3234. 1 ^ \d
  3235. 1 ^ \d
  3236. 1 ^ \d
  3237. 1 ^ \d
  3238. 2 ^ ^ d
  3239. 0: 4abcdef
  3240. \= Expect no match
  3241. abcdef
  3242. No match
  3243. /(?C255)ab/I
  3244. Capture group count = 0
  3245. First code unit = 'a'
  3246. Last code unit = 'b'
  3247. Subject length lower bound = 2
  3248. /(?C256)ab/I
  3249. Failed: error 138 at offset 6: number after (?C is greater than 255
  3250. /(?Cab)xx/I
  3251. Failed: error 182 at offset 3: unrecognized string delimiter follows (?C
  3252. /(?C12vr)x/I
  3253. Failed: error 139 at offset 5: closing parenthesis for (?C expected
  3254. /abc(?C)def/I
  3255. Capture group count = 0
  3256. First code unit = 'a'
  3257. Last code unit = 'f'
  3258. Subject length lower bound = 6
  3259. \x83\x0\x61bcdef
  3260. --->\x83\x00abcdef
  3261. 0 ^ ^ d
  3262. 0: abcdef
  3263. /(abc)(?C)de(?C1)f/I
  3264. Capture group count = 1
  3265. First code unit = 'a'
  3266. Last code unit = 'f'
  3267. Subject length lower bound = 6
  3268. 123abcdef
  3269. --->123abcdef
  3270. 0 ^ ^ d
  3271. 1 ^ ^ f
  3272. 0: abcdef
  3273. 1: abc
  3274. 123abcdef\=callout_capture
  3275. Callout 0: last capture = 1
  3276. 1: abc
  3277. --->123abcdef
  3278. ^ ^ d
  3279. Callout 1: last capture = 1
  3280. 1: abc
  3281. --->123abcdef
  3282. ^ ^ f
  3283. 0: abcdef
  3284. 1: abc
  3285. 123abcdefC-\=callout_none
  3286. 0: abcdef
  3287. 1: abc
  3288. \= Expect no match
  3289. 123abcdef\=callout_fail=1
  3290. --->123abcdef
  3291. 0 ^ ^ d
  3292. 1 ^ ^ f
  3293. No match
  3294. /(?C0)(abc(?C1))*/I
  3295. Capture group count = 1
  3296. May match empty string
  3297. Subject length lower bound = 0
  3298. abcabcabc
  3299. --->abcabcabc
  3300. 0 ^ (
  3301. 1 ^ ^ )*
  3302. 1 ^ ^ )*
  3303. 1 ^ ^ )*
  3304. 0: abcabcabc
  3305. 1: abc
  3306. abcabc\=callout_fail=1:4
  3307. --->abcabc
  3308. 0 ^ (
  3309. 1 ^ ^ )*
  3310. 1 ^ ^ )*
  3311. 0: abcabc
  3312. 1: abc
  3313. abcabcabc\=callout_fail=1:4
  3314. --->abcabcabc
  3315. 0 ^ (
  3316. 1 ^ ^ )*
  3317. 1 ^ ^ )*
  3318. 1 ^ ^ )*
  3319. 0: abcabc
  3320. 1: abc
  3321. /(\d{3}(?C))*/I
  3322. Capture group count = 1
  3323. May match empty string
  3324. Subject length lower bound = 0
  3325. 123\=callout_capture
  3326. Callout 0: last capture = 0
  3327. --->123
  3328. ^ ^ )*
  3329. 0: 123
  3330. 1: 123
  3331. 123456\=callout_capture
  3332. Callout 0: last capture = 0
  3333. --->123456
  3334. ^ ^ )*
  3335. Callout 0: last capture = 1
  3336. 1: 123
  3337. --->123456
  3338. ^ ^ )*
  3339. 0: 123456
  3340. 1: 456
  3341. 123456789\=callout_capture
  3342. Callout 0: last capture = 0
  3343. --->123456789
  3344. ^ ^ )*
  3345. Callout 0: last capture = 1
  3346. 1: 123
  3347. --->123456789
  3348. ^ ^ )*
  3349. Callout 0: last capture = 1
  3350. 1: 456
  3351. --->123456789
  3352. ^ ^ )*
  3353. 0: 123456789
  3354. 1: 789
  3355. /((xyz)(?C)p|(?C1)xyzabc)/I
  3356. Capture group count = 2
  3357. First code unit = 'x'
  3358. Subject length lower bound = 4
  3359. xyzabc\=callout_capture
  3360. Callout 0: last capture = 2
  3361. 1: <unset>
  3362. 2: xyz
  3363. --->xyzabc
  3364. ^ ^ p
  3365. Callout 1: last capture = 0
  3366. --->xyzabc
  3367. ^ x
  3368. 0: xyzabc
  3369. 1: xyzabc
  3370. /(X)((xyz)(?C)p|(?C1)xyzabc)/I
  3371. Capture group count = 3
  3372. First code unit = 'X'
  3373. Last code unit = 'x'
  3374. Subject length lower bound = 5
  3375. Xxyzabc\=callout_capture
  3376. Callout 0: last capture = 3
  3377. 1: X
  3378. 2: <unset>
  3379. 3: xyz
  3380. --->Xxyzabc
  3381. ^ ^ p
  3382. Callout 1: last capture = 1
  3383. 1: X
  3384. --->Xxyzabc
  3385. ^^ x
  3386. 0: Xxyzabc
  3387. 1: X
  3388. 2: xyzabc
  3389. /(?=(abc))(?C)abcdef/I
  3390. Capture group count = 1
  3391. First code unit = 'a'
  3392. Last code unit = 'f'
  3393. Subject length lower bound = 6
  3394. abcdef\=callout_capture
  3395. Callout 0: last capture = 1
  3396. 1: abc
  3397. --->abcdef
  3398. ^ a
  3399. 0: abcdef
  3400. 1: abc
  3401. /(?!(abc)(?C1)d)(?C2)abcxyz/I
  3402. Capture group count = 1
  3403. First code unit = 'a'
  3404. Last code unit = 'z'
  3405. Subject length lower bound = 6
  3406. abcxyz\=callout_capture
  3407. Callout 1: last capture = 1
  3408. 1: abc
  3409. --->abcxyz
  3410. ^ ^ d
  3411. Callout 2: last capture = 0
  3412. --->abcxyz
  3413. ^ a
  3414. 0: abcxyz
  3415. /(?<=(abc)(?C))xyz/I
  3416. Capture group count = 1
  3417. Max lookbehind = 3
  3418. First code unit = 'x'
  3419. Last code unit = 'z'
  3420. Subject length lower bound = 3
  3421. abcxyz\=callout_capture
  3422. Callout 0: last capture = 1
  3423. 1: abc
  3424. --->abcxyz
  3425. ^ )
  3426. 0: xyz
  3427. 1: abc
  3428. /a(b+)(c*)(?C1)/I
  3429. Capture group count = 2
  3430. First code unit = 'a'
  3431. Last code unit = 'b'
  3432. Subject length lower bound = 2
  3433. \= Expect no match
  3434. abbbbbccc\=callout_data=1
  3435. --->abbbbbccc
  3436. 1 ^ ^ End of pattern
  3437. Callout data = 1
  3438. No match
  3439. /a(b+?)(c*?)(?C1)/I
  3440. Capture group count = 2
  3441. First code unit = 'a'
  3442. Last code unit = 'b'
  3443. Subject length lower bound = 2
  3444. \= Expect no match
  3445. abbbbbccc\=callout_data=1
  3446. --->abbbbbccc
  3447. 1 ^ ^ End of pattern
  3448. Callout data = 1
  3449. 1 ^ ^ End of pattern
  3450. Callout data = 1
  3451. 1 ^ ^ End of pattern
  3452. Callout data = 1
  3453. 1 ^ ^ End of pattern
  3454. Callout data = 1
  3455. 1 ^ ^ End of pattern
  3456. Callout data = 1
  3457. 1 ^ ^ End of pattern
  3458. Callout data = 1
  3459. 1 ^ ^ End of pattern
  3460. Callout data = 1
  3461. 1 ^ ^ End of pattern
  3462. Callout data = 1
  3463. No match
  3464. /(?C)abc/I
  3465. Capture group count = 0
  3466. First code unit = 'a'
  3467. Last code unit = 'c'
  3468. Subject length lower bound = 3
  3469. /(?C)^abc/I
  3470. Capture group count = 0
  3471. Compile options: <none>
  3472. Overall options: anchored
  3473. First code unit = 'a'
  3474. Subject length lower bound = 3
  3475. /(?C)a|b/I
  3476. Capture group count = 0
  3477. Starting code units: a b
  3478. Subject length lower bound = 1
  3479. /a|(b)(?C)/I
  3480. Capture group count = 1
  3481. Starting code units: a b
  3482. Subject length lower bound = 1
  3483. b
  3484. --->b
  3485. 0 ^^ End of pattern
  3486. 0: b
  3487. 1: b
  3488. /x(ab|(bc|(de|(?R))))/I
  3489. Capture group count = 3
  3490. First code unit = 'x'
  3491. Subject length lower bound = 3
  3492. xab
  3493. 0: xab
  3494. 1: ab
  3495. xbc
  3496. 0: xbc
  3497. 1: bc
  3498. 2: bc
  3499. xde
  3500. 0: xde
  3501. 1: de
  3502. 2: de
  3503. 3: de
  3504. xxab
  3505. 0: xxab
  3506. 1: xab
  3507. 2: xab
  3508. 3: xab
  3509. xxxab
  3510. 0: xxxab
  3511. 1: xxab
  3512. 2: xxab
  3513. 3: xxab
  3514. \= Expect no match
  3515. xyab
  3516. No match
  3517. /^([^()]|\((?1)*\))*$/I
  3518. Capture group count = 1
  3519. May match empty string
  3520. Compile options: <none>
  3521. Overall options: anchored
  3522. Subject length lower bound = 0
  3523. abc
  3524. 0: abc
  3525. 1: c
  3526. a(b)c
  3527. 0: a(b)c
  3528. 1: c
  3529. a(b(c))d
  3530. 0: a(b(c))d
  3531. 1: d
  3532. \= Expect no match)
  3533. a(b(c)d
  3534. No match
  3535. /^>abc>([^()]|\((?1)*\))*<xyz<$/I
  3536. Capture group count = 1
  3537. Compile options: <none>
  3538. Overall options: anchored
  3539. First code unit = '>'
  3540. Last code unit = '<'
  3541. Subject length lower bound = 10
  3542. >abc>123<xyz<
  3543. 0: >abc>123<xyz<
  3544. 1: 3
  3545. >abc>1(2)3<xyz<
  3546. 0: >abc>1(2)3<xyz<
  3547. 1: 3
  3548. >abc>(1(2)3)<xyz<
  3549. 0: >abc>(1(2)3)<xyz<
  3550. 1: (1(2)3)
  3551. /(a(?1)b)/IB
  3552. ------------------------------------------------------------------
  3553. Bra
  3554. CBra 1
  3555. a
  3556. Recurse
  3557. b
  3558. Ket
  3559. Ket
  3560. End
  3561. ------------------------------------------------------------------
  3562. Capture group count = 1
  3563. First code unit = 'a'
  3564. Last code unit = 'b'
  3565. Subject length lower bound = 2
  3566. /(a(?1)+b)/IB
  3567. ------------------------------------------------------------------
  3568. Bra
  3569. CBra 1
  3570. a
  3571. SBra
  3572. Recurse
  3573. KetRmax
  3574. b
  3575. Ket
  3576. Ket
  3577. End
  3578. ------------------------------------------------------------------
  3579. Capture group count = 1
  3580. First code unit = 'a'
  3581. Last code unit = 'b'
  3582. Subject length lower bound = 2
  3583. /^(\d+|\((?1)([+*-])(?1)\)|-(?1))$/I
  3584. Capture group count = 2
  3585. Compile options: <none>
  3586. Overall options: anchored
  3587. Starting code units: ( - 0 1 2 3 4 5 6 7 8 9
  3588. Subject length lower bound = 1
  3589. 12
  3590. 0: 12
  3591. 1: 12
  3592. (((2+2)*-3)-7)
  3593. 0: (((2+2)*-3)-7)
  3594. 1: (((2+2)*-3)-7)
  3595. 2: -
  3596. -12
  3597. 0: -12
  3598. 1: -12
  3599. \= Expect no match
  3600. ((2+2)*-3)-7)
  3601. No match
  3602. /^(x(y|(?1){2})z)/I
  3603. Capture group count = 2
  3604. Compile options: <none>
  3605. Overall options: anchored
  3606. First code unit = 'x'
  3607. Subject length lower bound = 3
  3608. xyz
  3609. 0: xyz
  3610. 1: xyz
  3611. 2: y
  3612. xxyzxyzz
  3613. 0: xxyzxyzz
  3614. 1: xxyzxyzz
  3615. 2: xyzxyz
  3616. \= Expect no match
  3617. xxyzz
  3618. No match
  3619. xxyzxyzxyzz
  3620. No match
  3621. /((< (?: (?(R) \d++ | [^<>]*+) | (?2)) * >))/Ix
  3622. Capture group count = 2
  3623. Options: extended
  3624. First code unit = '<'
  3625. Last code unit = '>'
  3626. Subject length lower bound = 2
  3627. <>
  3628. 0: <>
  3629. 1: <>
  3630. 2: <>
  3631. <abcd>
  3632. 0: <abcd>
  3633. 1: <abcd>
  3634. 2: <abcd>
  3635. <abc <123> hij>
  3636. 0: <abc <123> hij>
  3637. 1: <abc <123> hij>
  3638. 2: <abc <123> hij>
  3639. <abc <def> hij>
  3640. 0: <def>
  3641. 1: <def>
  3642. 2: <def>
  3643. <abc<>def>
  3644. 0: <abc<>def>
  3645. 1: <abc<>def>
  3646. 2: <abc<>def>
  3647. <abc<>
  3648. 0: <>
  3649. 1: <>
  3650. 2: <>
  3651. \= Expect no match
  3652. <abc
  3653. No match
  3654. /(?1)/I
  3655. Failed: error 115 at offset 3: reference to non-existent subpattern
  3656. /((?2)(abc)/I
  3657. Failed: error 114 at offset 10: missing closing parenthesis
  3658. /^(abc)def(?1)/I
  3659. Capture group count = 1
  3660. Compile options: <none>
  3661. Overall options: anchored
  3662. First code unit = 'a'
  3663. Subject length lower bound = 9
  3664. abcdefabc
  3665. 0: abcdefabc
  3666. 1: abc
  3667. /^(a|b|c)=(?1)+/I
  3668. Capture group count = 1
  3669. Compile options: <none>
  3670. Overall options: anchored
  3671. Starting code units: a b c
  3672. Subject length lower bound = 2
  3673. a=a
  3674. 0: a=a
  3675. 1: a
  3676. a=b
  3677. 0: a=b
  3678. 1: a
  3679. a=bc
  3680. 0: a=bc
  3681. 1: a
  3682. /^(a|b|c)=((?1))+/I
  3683. Capture group count = 2
  3684. Compile options: <none>
  3685. Overall options: anchored
  3686. Starting code units: a b c
  3687. Subject length lower bound = 2
  3688. a=a
  3689. 0: a=a
  3690. 1: a
  3691. 2: a
  3692. a=b
  3693. 0: a=b
  3694. 1: a
  3695. 2: b
  3696. a=bc
  3697. 0: a=bc
  3698. 1: a
  3699. 2: c
  3700. /a(?P<name1>b|c)d(?P<longername2>e)/IB
  3701. ------------------------------------------------------------------
  3702. Bra
  3703. a
  3704. CBra 1
  3705. b
  3706. Alt
  3707. c
  3708. Ket
  3709. d
  3710. CBra 2
  3711. e
  3712. Ket
  3713. Ket
  3714. End
  3715. ------------------------------------------------------------------
  3716. Capture group count = 2
  3717. Named capture groups:
  3718. longername2 2
  3719. name1 1
  3720. First code unit = 'a'
  3721. Last code unit = 'e'
  3722. Subject length lower bound = 4
  3723. abde
  3724. 0: abde
  3725. 1: b
  3726. 2: e
  3727. acde
  3728. 0: acde
  3729. 1: c
  3730. 2: e
  3731. /(?:a(?P<c>c(?P<d>d)))(?P<a>a)/IB
  3732. ------------------------------------------------------------------
  3733. Bra
  3734. Bra
  3735. a
  3736. CBra 1
  3737. c
  3738. CBra 2
  3739. d
  3740. Ket
  3741. Ket
  3742. Ket
  3743. CBra 3
  3744. a
  3745. Ket
  3746. Ket
  3747. End
  3748. ------------------------------------------------------------------
  3749. Capture group count = 3
  3750. Named capture groups:
  3751. a 3
  3752. c 1
  3753. d 2
  3754. First code unit = 'a'
  3755. Last code unit = 'a'
  3756. Subject length lower bound = 4
  3757. /(?P<a>a)...(?P=a)bbb(?P>a)d/IB
  3758. ------------------------------------------------------------------
  3759. Bra
  3760. CBra 1
  3761. a
  3762. Ket
  3763. Any
  3764. Any
  3765. Any
  3766. \1
  3767. bbb
  3768. Recurse
  3769. d
  3770. Ket
  3771. End
  3772. ------------------------------------------------------------------
  3773. Capture group count = 1
  3774. Max back reference = 1
  3775. Named capture groups:
  3776. a 1
  3777. First code unit = 'a'
  3778. Last code unit = 'd'
  3779. Subject length lower bound = 10
  3780. /^\W*(?:(?P<one>(?P<two>.)\W*(?P>one)\W*(?P=two)|)|(?P<three>(?P<four>.)\W*(?P>three)\W*(?P=four)|\W*.\W*))\W*$/Ii
  3781. Capture group count = 4
  3782. Max back reference = 4
  3783. Named capture groups:
  3784. four 4
  3785. one 1
  3786. three 3
  3787. two 2
  3788. May match empty string
  3789. Compile options: caseless
  3790. Overall options: anchored caseless
  3791. Subject length lower bound = 0
  3792. 1221
  3793. 0: 1221
  3794. 1: 1221
  3795. 2: 1
  3796. Satan, oscillate my metallic sonatas!
  3797. 0: Satan, oscillate my metallic sonatas!
  3798. 1: <unset>
  3799. 2: <unset>
  3800. 3: Satan, oscillate my metallic sonatas
  3801. 4: S
  3802. A man, a plan, a canal: Panama!
  3803. 0: A man, a plan, a canal: Panama!
  3804. 1: <unset>
  3805. 2: <unset>
  3806. 3: A man, a plan, a canal: Panama
  3807. 4: A
  3808. Able was I ere I saw Elba.
  3809. 0: Able was I ere I saw Elba.
  3810. 1: <unset>
  3811. 2: <unset>
  3812. 3: Able was I ere I saw Elba
  3813. 4: A
  3814. \= Expect no match
  3815. The quick brown fox
  3816. No match
  3817. /((?(R)a|b))\1(?1)?/I
  3818. Capture group count = 1
  3819. Max back reference = 1
  3820. Subject length lower bound = 2
  3821. bb
  3822. 0: bb
  3823. 1: b
  3824. bbaa
  3825. 0: bba
  3826. 1: b
  3827. /(.*)a/Is
  3828. Capture group count = 1
  3829. Compile options: dotall
  3830. Overall options: anchored dotall
  3831. Last code unit = 'a'
  3832. Subject length lower bound = 1
  3833. /(.*)a\1/Is
  3834. Capture group count = 1
  3835. Max back reference = 1
  3836. Options: dotall
  3837. Last code unit = 'a'
  3838. Subject length lower bound = 1
  3839. /(.*)a(b)\2/Is
  3840. Capture group count = 2
  3841. Max back reference = 2
  3842. Compile options: dotall
  3843. Overall options: anchored dotall
  3844. Last code unit = 'b'
  3845. Subject length lower bound = 3
  3846. /((.*)a|(.*)b)z/Is
  3847. Capture group count = 3
  3848. Compile options: dotall
  3849. Overall options: anchored dotall
  3850. Last code unit = 'z'
  3851. Subject length lower bound = 2
  3852. /((.*)a|(.*)b)z\1/Is
  3853. Capture group count = 3
  3854. Max back reference = 1
  3855. Options: dotall
  3856. Last code unit = 'z'
  3857. Subject length lower bound = 3
  3858. /((.*)a|(.*)b)z\2/Is
  3859. Capture group count = 3
  3860. Max back reference = 2
  3861. Options: dotall
  3862. Last code unit = 'z'
  3863. Subject length lower bound = 2
  3864. /((.*)a|(.*)b)z\3/Is
  3865. Capture group count = 3
  3866. Max back reference = 3
  3867. Options: dotall
  3868. Last code unit = 'z'
  3869. Subject length lower bound = 2
  3870. /((.*)a|^(.*)b)z\3/Is
  3871. Capture group count = 3
  3872. Max back reference = 3
  3873. Compile options: dotall
  3874. Overall options: anchored dotall
  3875. Last code unit = 'z'
  3876. Subject length lower bound = 2
  3877. /(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)a/Is
  3878. Capture group count = 31
  3879. May match empty string
  3880. Compile options: dotall
  3881. Overall options: anchored dotall
  3882. Subject length lower bound = 0
  3883. /(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)a\31/Is
  3884. Capture group count = 31
  3885. Max back reference = 31
  3886. May match empty string
  3887. Options: dotall
  3888. Subject length lower bound = 0
  3889. /(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)a\32/Is
  3890. Capture group count = 32
  3891. Max back reference = 32
  3892. May match empty string
  3893. Options: dotall
  3894. Subject length lower bound = 0
  3895. /(a)(bc)/IB,no_auto_capture
  3896. ------------------------------------------------------------------
  3897. Bra
  3898. Bra
  3899. a
  3900. Ket
  3901. Bra
  3902. bc
  3903. Ket
  3904. Ket
  3905. End
  3906. ------------------------------------------------------------------
  3907. Capture group count = 0
  3908. Options: no_auto_capture
  3909. First code unit = 'a'
  3910. Last code unit = 'c'
  3911. Subject length lower bound = 3
  3912. abc
  3913. 0: abc
  3914. /(?P<one>a)(bc)/IB,no_auto_capture
  3915. ------------------------------------------------------------------
  3916. Bra
  3917. CBra 1
  3918. a
  3919. Ket
  3920. Bra
  3921. bc
  3922. Ket
  3923. Ket
  3924. End
  3925. ------------------------------------------------------------------
  3926. Capture group count = 1
  3927. Named capture groups:
  3928. one 1
  3929. Options: no_auto_capture
  3930. First code unit = 'a'
  3931. Last code unit = 'c'
  3932. Subject length lower bound = 3
  3933. abc
  3934. 0: abc
  3935. 1: a
  3936. /(a)(?P<named>bc)/IB,no_auto_capture
  3937. ------------------------------------------------------------------
  3938. Bra
  3939. Bra
  3940. a
  3941. Ket
  3942. CBra 1
  3943. bc
  3944. Ket
  3945. Ket
  3946. End
  3947. ------------------------------------------------------------------
  3948. Capture group count = 1
  3949. Named capture groups:
  3950. named 1
  3951. Options: no_auto_capture
  3952. First code unit = 'a'
  3953. Last code unit = 'c'
  3954. Subject length lower bound = 3
  3955. /(aaa(?C1)bbb|ab)/I
  3956. Capture group count = 1
  3957. First code unit = 'a'
  3958. Last code unit = 'b'
  3959. Subject length lower bound = 2
  3960. aaabbb
  3961. --->aaabbb
  3962. 1 ^ ^ b
  3963. 0: aaabbb
  3964. 1: aaabbb
  3965. aaabbb\=callout_data=0
  3966. --->aaabbb
  3967. 1 ^ ^ b
  3968. 0: aaabbb
  3969. 1: aaabbb
  3970. aaabbb\=callout_data=1
  3971. --->aaabbb
  3972. 1 ^ ^ b
  3973. Callout data = 1
  3974. 0: ab
  3975. 1: ab
  3976. \= Expect no match
  3977. aaabbb\=callout_data=-1
  3978. --->aaabbb
  3979. 1 ^ ^ b
  3980. Callout data = -1
  3981. No match
  3982. /ab(?P<one>cd)ef(?P<two>gh)/I
  3983. Capture group count = 2
  3984. Named capture groups:
  3985. one 1
  3986. two 2
  3987. First code unit = 'a'
  3988. Last code unit = 'h'
  3989. Subject length lower bound = 8
  3990. abcdefgh
  3991. 0: abcdefgh
  3992. 1: cd
  3993. 2: gh
  3994. abcdefgh\=copy=1,get=two
  3995. 0: abcdefgh
  3996. 1: cd
  3997. 2: gh
  3998. 1C cd (2)
  3999. G gh (2) two (group 2)
  4000. abcdefgh\=copy=one,copy=two
  4001. 0: abcdefgh
  4002. 1: cd
  4003. 2: gh
  4004. C cd (2) one (group 1)
  4005. C gh (2) two (group 2)
  4006. abcdefgh\=copy=three
  4007. 0: abcdefgh
  4008. 1: cd
  4009. 2: gh
  4010. Number not found for group 'three'
  4011. Copy substring 'three' failed (-49): unknown substring
  4012. /(?P<Tes>)(?P<Test>)/IB
  4013. ------------------------------------------------------------------
  4014. Bra
  4015. CBra 1
  4016. Ket
  4017. CBra 2
  4018. Ket
  4019. Ket
  4020. End
  4021. ------------------------------------------------------------------
  4022. Capture group count = 2
  4023. Named capture groups:
  4024. Tes 1
  4025. Test 2
  4026. May match empty string
  4027. Subject length lower bound = 0
  4028. /(?P<Test>)(?P<Tes>)/IB
  4029. ------------------------------------------------------------------
  4030. Bra
  4031. CBra 1
  4032. Ket
  4033. CBra 2
  4034. Ket
  4035. Ket
  4036. End
  4037. ------------------------------------------------------------------
  4038. Capture group count = 2
  4039. Named capture groups:
  4040. Tes 2
  4041. Test 1
  4042. May match empty string
  4043. Subject length lower bound = 0
  4044. /(?P<Z>zz)(?P<A>aa)/I
  4045. Capture group count = 2
  4046. Named capture groups:
  4047. A 2
  4048. Z 1
  4049. First code unit = 'z'
  4050. Last code unit = 'a'
  4051. Subject length lower bound = 4
  4052. zzaa\=copy=Z
  4053. 0: zzaa
  4054. 1: zz
  4055. 2: aa
  4056. C zz (2) Z (group 1)
  4057. zzaa\=copy=A
  4058. 0: zzaa
  4059. 1: zz
  4060. 2: aa
  4061. C aa (2) A (group 2)
  4062. /(?P<x>eks)(?P<x>eccs)/I
  4063. Failed: error 143 at offset 16: two named subpatterns have the same name (PCRE2_DUPNAMES not set)
  4064. /(?P<abc>abc(?P<def>def)(?P<abc>xyz))/I
  4065. Failed: error 143 at offset 31: two named subpatterns have the same name (PCRE2_DUPNAMES not set)
  4066. "\[((?P<elem>\d+)(,(?P>elem))*)\]"I
  4067. Capture group count = 3
  4068. Named capture groups:
  4069. elem 2
  4070. First code unit = '['
  4071. Last code unit = ']'
  4072. Subject length lower bound = 3
  4073. [10,20,30,5,5,4,4,2,43,23,4234]
  4074. 0: [10,20,30,5,5,4,4,2,43,23,4234]
  4075. 1: 10,20,30,5,5,4,4,2,43,23,4234
  4076. 2: 10
  4077. 3: ,4234
  4078. \= Expect no match
  4079. []
  4080. No match
  4081. "\[((?P<elem>\d+)(,(?P>elem))*)?\]"I
  4082. Capture group count = 3
  4083. Named capture groups:
  4084. elem 2
  4085. First code unit = '['
  4086. Last code unit = ']'
  4087. Subject length lower bound = 2
  4088. [10,20,30,5,5,4,4,2,43,23,4234]
  4089. 0: [10,20,30,5,5,4,4,2,43,23,4234]
  4090. 1: 10,20,30,5,5,4,4,2,43,23,4234
  4091. 2: 10
  4092. 3: ,4234
  4093. []
  4094. 0: []
  4095. /(a(b(?2)c))?/IB
  4096. ------------------------------------------------------------------
  4097. Bra
  4098. Brazero
  4099. CBra 1
  4100. a
  4101. CBra 2
  4102. b
  4103. Recurse
  4104. c
  4105. Ket
  4106. Ket
  4107. Ket
  4108. End
  4109. ------------------------------------------------------------------
  4110. Capture group count = 2
  4111. May match empty string
  4112. Subject length lower bound = 0
  4113. /(a(b(?2)c))*/IB
  4114. ------------------------------------------------------------------
  4115. Bra
  4116. Brazero
  4117. CBra 1
  4118. a
  4119. CBra 2
  4120. b
  4121. Recurse
  4122. c
  4123. Ket
  4124. KetRmax
  4125. Ket
  4126. End
  4127. ------------------------------------------------------------------
  4128. Capture group count = 2
  4129. May match empty string
  4130. Subject length lower bound = 0
  4131. /(a(b(?2)c)){0,2}/IB
  4132. ------------------------------------------------------------------
  4133. Bra
  4134. Brazero
  4135. Bra
  4136. CBra 1
  4137. a
  4138. CBra 2
  4139. b
  4140. Recurse
  4141. c
  4142. Ket
  4143. Ket
  4144. Brazero
  4145. CBra 1
  4146. a
  4147. CBra 2
  4148. b
  4149. Recurse
  4150. c
  4151. Ket
  4152. Ket
  4153. Ket
  4154. Ket
  4155. End
  4156. ------------------------------------------------------------------
  4157. Capture group count = 2
  4158. May match empty string
  4159. Subject length lower bound = 0
  4160. /[ab]{1}+/B
  4161. ------------------------------------------------------------------
  4162. Bra
  4163. [ab]
  4164. Ket
  4165. End
  4166. ------------------------------------------------------------------
  4167. /()(?1){1}/B
  4168. ------------------------------------------------------------------
  4169. Bra
  4170. CBra 1
  4171. Ket
  4172. Recurse
  4173. Ket
  4174. End
  4175. ------------------------------------------------------------------
  4176. /()(?1)/B
  4177. ------------------------------------------------------------------
  4178. Bra
  4179. CBra 1
  4180. Ket
  4181. Recurse
  4182. Ket
  4183. End
  4184. ------------------------------------------------------------------
  4185. /((w\/|-|with)*(free|immediate)*.*?shipping\s*[!.-]*)/Ii
  4186. Capture group count = 3
  4187. Options: caseless
  4188. Last code unit = 'g' (caseless)
  4189. Subject length lower bound = 8
  4190. Baby Bjorn Active Carrier - With free SHIPPING!!
  4191. 0: Baby Bjorn Active Carrier - With free SHIPPING!!
  4192. 1: Baby Bjorn Active Carrier - With free SHIPPING!!
  4193. /((w\/|-|with)*(free|immediate)*.*?shipping\s*[!.-]*)/Ii
  4194. Capture group count = 3
  4195. Options: caseless
  4196. Last code unit = 'g' (caseless)
  4197. Subject length lower bound = 8
  4198. Baby Bjorn Active Carrier - With free SHIPPING!!
  4199. 0: Baby Bjorn Active Carrier - With free SHIPPING!!
  4200. 1: Baby Bjorn Active Carrier - With free SHIPPING!!
  4201. /a*.*b/IB
  4202. ------------------------------------------------------------------
  4203. Bra
  4204. a*
  4205. Any*
  4206. b
  4207. Ket
  4208. End
  4209. ------------------------------------------------------------------
  4210. Capture group count = 0
  4211. Last code unit = 'b'
  4212. Subject length lower bound = 1
  4213. /(a|b)*.?c/IB
  4214. ------------------------------------------------------------------
  4215. Bra
  4216. Brazero
  4217. CBra 1
  4218. a
  4219. Alt
  4220. b
  4221. KetRmax
  4222. Any?
  4223. c
  4224. Ket
  4225. End
  4226. ------------------------------------------------------------------
  4227. Capture group count = 1
  4228. Last code unit = 'c'
  4229. Subject length lower bound = 1
  4230. /abc(?C255)de(?C)f/IB
  4231. ------------------------------------------------------------------
  4232. Bra
  4233. abc
  4234. Callout 255 10 1
  4235. de
  4236. Callout 0 16 1
  4237. f
  4238. Ket
  4239. End
  4240. ------------------------------------------------------------------
  4241. Capture group count = 0
  4242. First code unit = 'a'
  4243. Last code unit = 'f'
  4244. Subject length lower bound = 6
  4245. /abcde/IB,auto_callout
  4246. ------------------------------------------------------------------
  4247. Bra
  4248. Callout 255 0 1
  4249. a
  4250. Callout 255 1 1
  4251. b
  4252. Callout 255 2 1
  4253. c
  4254. Callout 255 3 1
  4255. d
  4256. Callout 255 4 1
  4257. e
  4258. Callout 255 5 0
  4259. Ket
  4260. End
  4261. ------------------------------------------------------------------
  4262. Capture group count = 0
  4263. Options: auto_callout
  4264. First code unit = 'a'
  4265. Last code unit = 'e'
  4266. Subject length lower bound = 5
  4267. abcde
  4268. --->abcde
  4269. +0 ^ a
  4270. +1 ^^ b
  4271. +2 ^ ^ c
  4272. +3 ^ ^ d
  4273. +4 ^ ^ e
  4274. +5 ^ ^ End of pattern
  4275. 0: abcde
  4276. \= Expect no match
  4277. abcdfe
  4278. --->abcdfe
  4279. +0 ^ a
  4280. +1 ^^ b
  4281. +2 ^ ^ c
  4282. +3 ^ ^ d
  4283. +4 ^ ^ e
  4284. No match
  4285. /a*b/IB,auto_callout
  4286. ------------------------------------------------------------------
  4287. Bra
  4288. Callout 255 0 2
  4289. a*+
  4290. Callout 255 2 1
  4291. b
  4292. Callout 255 3 0
  4293. Ket
  4294. End
  4295. ------------------------------------------------------------------
  4296. Capture group count = 0
  4297. Options: auto_callout
  4298. Starting code units: a b
  4299. Last code unit = 'b'
  4300. Subject length lower bound = 1
  4301. ab
  4302. --->ab
  4303. +0 ^ a*
  4304. +2 ^^ b
  4305. +3 ^ ^ End of pattern
  4306. 0: ab
  4307. aaaab
  4308. --->aaaab
  4309. +0 ^ a*
  4310. +2 ^ ^ b
  4311. +3 ^ ^ End of pattern
  4312. 0: aaaab
  4313. aaaacb
  4314. --->aaaacb
  4315. +0 ^ a*
  4316. +2 ^ ^ b
  4317. +0 ^ a*
  4318. +2 ^ ^ b
  4319. +0 ^ a*
  4320. +2 ^ ^ b
  4321. +0 ^ a*
  4322. +2 ^^ b
  4323. +0 ^ a*
  4324. +2 ^ b
  4325. +3 ^^ End of pattern
  4326. 0: b
  4327. /a*b/IB,auto_callout
  4328. ------------------------------------------------------------------
  4329. Bra
  4330. Callout 255 0 2
  4331. a*+
  4332. Callout 255 2 1
  4333. b
  4334. Callout 255 3 0
  4335. Ket
  4336. End
  4337. ------------------------------------------------------------------
  4338. Capture group count = 0
  4339. Options: auto_callout
  4340. Starting code units: a b
  4341. Last code unit = 'b'
  4342. Subject length lower bound = 1
  4343. ab
  4344. --->ab
  4345. +0 ^ a*
  4346. +2 ^^ b
  4347. +3 ^ ^ End of pattern
  4348. 0: ab
  4349. aaaab
  4350. --->aaaab
  4351. +0 ^ a*
  4352. +2 ^ ^ b
  4353. +3 ^ ^ End of pattern
  4354. 0: aaaab
  4355. aaaacb
  4356. --->aaaacb
  4357. +0 ^ a*
  4358. +2 ^ ^ b
  4359. +0 ^ a*
  4360. +2 ^ ^ b
  4361. +0 ^ a*
  4362. +2 ^ ^ b
  4363. +0 ^ a*
  4364. +2 ^^ b
  4365. +0 ^ a*
  4366. +2 ^ b
  4367. +3 ^^ End of pattern
  4368. 0: b
  4369. /a+b/IB,auto_callout
  4370. ------------------------------------------------------------------
  4371. Bra
  4372. Callout 255 0 2
  4373. a++
  4374. Callout 255 2 1
  4375. b
  4376. Callout 255 3 0
  4377. Ket
  4378. End
  4379. ------------------------------------------------------------------
  4380. Capture group count = 0
  4381. Options: auto_callout
  4382. First code unit = 'a'
  4383. Last code unit = 'b'
  4384. Subject length lower bound = 2
  4385. ab
  4386. --->ab
  4387. +0 ^ a+
  4388. +2 ^^ b
  4389. +3 ^ ^ End of pattern
  4390. 0: ab
  4391. aaaab
  4392. --->aaaab
  4393. +0 ^ a+
  4394. +2 ^ ^ b
  4395. +3 ^ ^ End of pattern
  4396. 0: aaaab
  4397. \= Expect no match
  4398. aaaacb
  4399. --->aaaacb
  4400. +0 ^ a+
  4401. +2 ^ ^ b
  4402. +0 ^ a+
  4403. +2 ^ ^ b
  4404. +0 ^ a+
  4405. +2 ^ ^ b
  4406. +0 ^ a+
  4407. +2 ^^ b
  4408. No match
  4409. /(abc|def)x/IB,auto_callout
  4410. ------------------------------------------------------------------
  4411. Bra
  4412. Callout 255 0 1
  4413. CBra 1
  4414. Callout 255 1 1
  4415. a
  4416. Callout 255 2 1
  4417. b
  4418. Callout 255 3 1
  4419. c
  4420. Callout 255 4 1
  4421. Alt
  4422. Callout 255 5 1
  4423. d
  4424. Callout 255 6 1
  4425. e
  4426. Callout 255 7 1
  4427. f
  4428. Callout 255 8 1
  4429. Ket
  4430. Callout 255 9 1
  4431. x
  4432. Callout 255 10 0
  4433. Ket
  4434. End
  4435. ------------------------------------------------------------------
  4436. Capture group count = 1
  4437. Options: auto_callout
  4438. Starting code units: a d
  4439. Last code unit = 'x'
  4440. Subject length lower bound = 4
  4441. abcx
  4442. --->abcx
  4443. +0 ^ (
  4444. +1 ^ a
  4445. +2 ^^ b
  4446. +3 ^ ^ c
  4447. +4 ^ ^ |
  4448. +9 ^ ^ x
  4449. +10 ^ ^ End of pattern
  4450. 0: abcx
  4451. 1: abc
  4452. defx
  4453. --->defx
  4454. +0 ^ (
  4455. +1 ^ a
  4456. +5 ^ d
  4457. +6 ^^ e
  4458. +7 ^ ^ f
  4459. +8 ^ ^ )
  4460. +9 ^ ^ x
  4461. +10 ^ ^ End of pattern
  4462. 0: defx
  4463. 1: def
  4464. \= Expect no match
  4465. abcdefzx
  4466. --->abcdefzx
  4467. +0 ^ (
  4468. +1 ^ a
  4469. +2 ^^ b
  4470. +3 ^ ^ c
  4471. +4 ^ ^ |
  4472. +9 ^ ^ x
  4473. +5 ^ d
  4474. +0 ^ (
  4475. +1 ^ a
  4476. +5 ^ d
  4477. +6 ^^ e
  4478. +7 ^ ^ f
  4479. +8 ^ ^ )
  4480. +9 ^ ^ x
  4481. No match
  4482. /(abc|def)x/IB,auto_callout
  4483. ------------------------------------------------------------------
  4484. Bra
  4485. Callout 255 0 1
  4486. CBra 1
  4487. Callout 255 1 1
  4488. a
  4489. Callout 255 2 1
  4490. b
  4491. Callout 255 3 1
  4492. c
  4493. Callout 255 4 1
  4494. Alt
  4495. Callout 255 5 1
  4496. d
  4497. Callout 255 6 1
  4498. e
  4499. Callout 255 7 1
  4500. f
  4501. Callout 255 8 1
  4502. Ket
  4503. Callout 255 9 1
  4504. x
  4505. Callout 255 10 0
  4506. Ket
  4507. End
  4508. ------------------------------------------------------------------
  4509. Capture group count = 1
  4510. Options: auto_callout
  4511. Starting code units: a d
  4512. Last code unit = 'x'
  4513. Subject length lower bound = 4
  4514. abcx
  4515. --->abcx
  4516. +0 ^ (
  4517. +1 ^ a
  4518. +2 ^^ b
  4519. +3 ^ ^ c
  4520. +4 ^ ^ |
  4521. +9 ^ ^ x
  4522. +10 ^ ^ End of pattern
  4523. 0: abcx
  4524. 1: abc
  4525. defx
  4526. --->defx
  4527. +0 ^ (
  4528. +1 ^ a
  4529. +5 ^ d
  4530. +6 ^^ e
  4531. +7 ^ ^ f
  4532. +8 ^ ^ )
  4533. +9 ^ ^ x
  4534. +10 ^ ^ End of pattern
  4535. 0: defx
  4536. 1: def
  4537. \= Expect no match
  4538. abcdefzx
  4539. --->abcdefzx
  4540. +0 ^ (
  4541. +1 ^ a
  4542. +2 ^^ b
  4543. +3 ^ ^ c
  4544. +4 ^ ^ |
  4545. +9 ^ ^ x
  4546. +5 ^ d
  4547. +0 ^ (
  4548. +1 ^ a
  4549. +5 ^ d
  4550. +6 ^^ e
  4551. +7 ^ ^ f
  4552. +8 ^ ^ )
  4553. +9 ^ ^ x
  4554. No match
  4555. /(ab|cd){3,4}/I,auto_callout
  4556. Capture group count = 1
  4557. Options: auto_callout
  4558. Starting code units: a c
  4559. Subject length lower bound = 6
  4560. ababab
  4561. --->ababab
  4562. +0 ^ (
  4563. +1 ^ a
  4564. +2 ^^ b
  4565. +3 ^ ^ |
  4566. +1 ^ ^ a
  4567. +2 ^ ^ b
  4568. +3 ^ ^ |
  4569. +1 ^ ^ a
  4570. +2 ^ ^ b
  4571. +3 ^ ^ |
  4572. +1 ^ ^ a
  4573. +4 ^ ^ c
  4574. +12 ^ ^ End of pattern
  4575. 0: ababab
  4576. 1: ab
  4577. abcdabcd
  4578. --->abcdabcd
  4579. +0 ^ (
  4580. +1 ^ a
  4581. +2 ^^ b
  4582. +3 ^ ^ |
  4583. +1 ^ ^ a
  4584. +4 ^ ^ c
  4585. +5 ^ ^ d
  4586. +6 ^ ^ ){3,4}
  4587. +1 ^ ^ a
  4588. +2 ^ ^ b
  4589. +3 ^ ^ |
  4590. +1 ^ ^ a
  4591. +4 ^ ^ c
  4592. +5 ^ ^ d
  4593. +6 ^ ^ ){3,4}
  4594. +12 ^ ^ End of pattern
  4595. 0: abcdabcd
  4596. 1: cd
  4597. abcdcdcdcdcd
  4598. --->abcdcdcdcdcd
  4599. +0 ^ (
  4600. +1 ^ a
  4601. +2 ^^ b
  4602. +3 ^ ^ |
  4603. +1 ^ ^ a
  4604. +4 ^ ^ c
  4605. +5 ^ ^ d
  4606. +6 ^ ^ ){3,4}
  4607. +1 ^ ^ a
  4608. +4 ^ ^ c
  4609. +5 ^ ^ d
  4610. +6 ^ ^ ){3,4}
  4611. +1 ^ ^ a
  4612. +4 ^ ^ c
  4613. +5 ^ ^ d
  4614. +6 ^ ^ ){3,4}
  4615. +12 ^ ^ End of pattern
  4616. 0: abcdcdcd
  4617. 1: cd
  4618. /([ab]{,4}c|xy)/IB,auto_callout
  4619. ------------------------------------------------------------------
  4620. Bra
  4621. Callout 255 0 1
  4622. CBra 1
  4623. Callout 255 1 4
  4624. [ab]
  4625. Callout 255 5 1
  4626. {
  4627. Callout 255 6 1
  4628. ,
  4629. Callout 255 7 1
  4630. 4
  4631. Callout 255 8 1
  4632. }
  4633. Callout 255 9 1
  4634. c
  4635. Callout 255 10 1
  4636. Alt
  4637. Callout 255 11 1
  4638. x
  4639. Callout 255 12 1
  4640. y
  4641. Callout 255 13 1
  4642. Ket
  4643. Callout 255 14 0
  4644. Ket
  4645. End
  4646. ------------------------------------------------------------------
  4647. Capture group count = 1
  4648. Options: auto_callout
  4649. Starting code units: a b x
  4650. Subject length lower bound = 2
  4651. \= Expect no match
  4652. Note: that { does NOT introduce a quantifier
  4653. --->Note: that { does NOT introduce a quantifier
  4654. +0 ^ (
  4655. +1 ^ [ab]
  4656. +5 ^^ {
  4657. +11 ^ x
  4658. +0 ^ (
  4659. +1 ^ [ab]
  4660. +5 ^^ {
  4661. +11 ^ x
  4662. +0 ^ (
  4663. +1 ^ [ab]
  4664. +5 ^^ {
  4665. +11 ^ x
  4666. No match
  4667. /([ab]{,4}c|xy)/IB,auto_callout
  4668. ------------------------------------------------------------------
  4669. Bra
  4670. Callout 255 0 1
  4671. CBra 1
  4672. Callout 255 1 4
  4673. [ab]
  4674. Callout 255 5 1
  4675. {
  4676. Callout 255 6 1
  4677. ,
  4678. Callout 255 7 1
  4679. 4
  4680. Callout 255 8 1
  4681. }
  4682. Callout 255 9 1
  4683. c
  4684. Callout 255 10 1
  4685. Alt
  4686. Callout 255 11 1
  4687. x
  4688. Callout 255 12 1
  4689. y
  4690. Callout 255 13 1
  4691. Ket
  4692. Callout 255 14 0
  4693. Ket
  4694. End
  4695. ------------------------------------------------------------------
  4696. Capture group count = 1
  4697. Options: auto_callout
  4698. Starting code units: a b x
  4699. Subject length lower bound = 2
  4700. \= Expect no match
  4701. Note: that { does NOT introduce a quantifier
  4702. --->Note: that { does NOT introduce a quantifier
  4703. +0 ^ (
  4704. +1 ^ [ab]
  4705. +5 ^^ {
  4706. +11 ^ x
  4707. +0 ^ (
  4708. +1 ^ [ab]
  4709. +5 ^^ {
  4710. +11 ^ x
  4711. +0 ^ (
  4712. +1 ^ [ab]
  4713. +5 ^^ {
  4714. +11 ^ x
  4715. No match
  4716. /([ab]{1,4}c|xy){4,5}?123/IB,auto_callout
  4717. ------------------------------------------------------------------
  4718. Bra
  4719. Callout 255 0 1
  4720. CBra 1
  4721. Callout 255 1 9
  4722. [ab]{1,4}+
  4723. Callout 255 10 1
  4724. c
  4725. Callout 255 11 1
  4726. Alt
  4727. Callout 255 12 1
  4728. x
  4729. Callout 255 13 1
  4730. y
  4731. Callout 255 14 7
  4732. Ket
  4733. CBra 1
  4734. Callout 255 1 9
  4735. [ab]{1,4}+
  4736. Callout 255 10 1
  4737. c
  4738. Callout 255 11 1
  4739. Alt
  4740. Callout 255 12 1
  4741. x
  4742. Callout 255 13 1
  4743. y
  4744. Callout 255 14 7
  4745. Ket
  4746. CBra 1
  4747. Callout 255 1 9
  4748. [ab]{1,4}+
  4749. Callout 255 10 1
  4750. c
  4751. Callout 255 11 1
  4752. Alt
  4753. Callout 255 12 1
  4754. x
  4755. Callout 255 13 1
  4756. y
  4757. Callout 255 14 7
  4758. Ket
  4759. CBra 1
  4760. Callout 255 1 9
  4761. [ab]{1,4}+
  4762. Callout 255 10 1
  4763. c
  4764. Callout 255 11 1
  4765. Alt
  4766. Callout 255 12 1
  4767. x
  4768. Callout 255 13 1
  4769. y
  4770. Callout 255 14 7
  4771. Ket
  4772. Braminzero
  4773. CBra 1
  4774. Callout 255 1 9
  4775. [ab]{1,4}+
  4776. Callout 255 10 1
  4777. c
  4778. Callout 255 11 1
  4779. Alt
  4780. Callout 255 12 1
  4781. x
  4782. Callout 255 13 1
  4783. y
  4784. Callout 255 14 7
  4785. Ket
  4786. Callout 255 21 1
  4787. 1
  4788. Callout 255 22 1
  4789. 2
  4790. Callout 255 23 1
  4791. 3
  4792. Callout 255 24 0
  4793. Ket
  4794. End
  4795. ------------------------------------------------------------------
  4796. Capture group count = 1
  4797. Options: auto_callout
  4798. Starting code units: a b x
  4799. Last code unit = '3'
  4800. Subject length lower bound = 11
  4801. aacaacaacaacaac123
  4802. --->aacaacaacaacaac123
  4803. +0 ^ (
  4804. +1 ^ [ab]{1,4}
  4805. +10 ^ ^ c
  4806. +11 ^ ^ |
  4807. +1 ^ ^ [ab]{1,4}
  4808. +10 ^ ^ c
  4809. +11 ^ ^ |
  4810. +1 ^ ^ [ab]{1,4}
  4811. +10 ^ ^ c
  4812. +11 ^ ^ |
  4813. +1 ^ ^ [ab]{1,4}
  4814. +10 ^ ^ c
  4815. +11 ^ ^ |
  4816. +21 ^ ^ 1
  4817. +1 ^ ^ [ab]{1,4}
  4818. +10 ^ ^ c
  4819. +11 ^ ^ |
  4820. +21 ^ ^ 1
  4821. +22 ^ ^ 2
  4822. +23 ^ ^ 3
  4823. +24 ^ ^ End of pattern
  4824. 0: aacaacaacaacaac123
  4825. 1: aac
  4826. /\b.*/I
  4827. Capture group count = 0
  4828. Max lookbehind = 1
  4829. May match empty string
  4830. Subject length lower bound = 0
  4831. ab cd\=offset=1
  4832. 0: cd
  4833. /\b.*/Is
  4834. Capture group count = 0
  4835. Max lookbehind = 1
  4836. May match empty string
  4837. Options: dotall
  4838. Subject length lower bound = 0
  4839. ab cd\=startoffset=1
  4840. 0: cd
  4841. /(?!.bcd).*/I
  4842. Capture group count = 0
  4843. May match empty string
  4844. Subject length lower bound = 0
  4845. Xbcd12345
  4846. 0: bcd12345
  4847. /abcde/I
  4848. Capture group count = 0
  4849. First code unit = 'a'
  4850. Last code unit = 'e'
  4851. Subject length lower bound = 5
  4852. ab\=ps
  4853. Partial match: ab
  4854. abc\=ps
  4855. Partial match: abc
  4856. abcd\=ps
  4857. Partial match: abcd
  4858. abcde\=ps
  4859. 0: abcde
  4860. the quick brown abc\=ps
  4861. Partial match: abc
  4862. \= Expect no match\=ps
  4863. the quick brown abxyz fox\=ps
  4864. No match
  4865. "^(0?[1-9]|[12][0-9]|3[01])/(0?[1-9]|1[012])/(20)?\d\d$"I
  4866. Capture group count = 3
  4867. Compile options: <none>
  4868. Overall options: anchored
  4869. Starting code units: 0 1 2 3 4 5 6 7 8 9
  4870. Last code unit = '/'
  4871. Subject length lower bound = 6
  4872. 13/05/04\=ps
  4873. 0: 13/05/04
  4874. 1: 13
  4875. 2: 05
  4876. 13/5/2004\=ps
  4877. 0: 13/5/2004
  4878. 1: 13
  4879. 2: 5
  4880. 3: 20
  4881. 02/05/09\=ps
  4882. 0: 02/05/09
  4883. 1: 02
  4884. 2: 05
  4885. 1\=ps
  4886. Partial match: 1
  4887. 1/2\=ps
  4888. Partial match: 1/2
  4889. 1/2/0\=ps
  4890. Partial match: 1/2/0
  4891. 1/2/04\=ps
  4892. 0: 1/2/04
  4893. 1: 1
  4894. 2: 2
  4895. 0\=ps
  4896. Partial match: 0
  4897. 02/\=ps
  4898. Partial match: 02/
  4899. 02/0\=ps
  4900. Partial match: 02/0
  4901. 02/1\=ps
  4902. Partial match: 02/1
  4903. \= Expect no match\=ps
  4904. \=ps
  4905. No match
  4906. 123\=ps
  4907. No match
  4908. 33/4/04\=ps
  4909. No match
  4910. 3/13/04\=ps
  4911. No match
  4912. 0/1/2003\=ps
  4913. No match
  4914. 0/\=ps
  4915. No match
  4916. 02/0/\=ps
  4917. No match
  4918. 02/13\=ps
  4919. No match
  4920. /0{0,2}ABC/I
  4921. Capture group count = 0
  4922. Starting code units: 0 A
  4923. Last code unit = 'C'
  4924. Subject length lower bound = 3
  4925. /\d{3,}ABC/I
  4926. Capture group count = 0
  4927. Starting code units: 0 1 2 3 4 5 6 7 8 9
  4928. Last code unit = 'C'
  4929. Subject length lower bound = 6
  4930. /\d*ABC/I
  4931. Capture group count = 0
  4932. Starting code units: 0 1 2 3 4 5 6 7 8 9 A
  4933. Last code unit = 'C'
  4934. Subject length lower bound = 3
  4935. /[abc]+DE/I
  4936. Capture group count = 0
  4937. Starting code units: a b c
  4938. Last code unit = 'E'
  4939. Subject length lower bound = 3
  4940. /[abc]?123/I
  4941. Capture group count = 0
  4942. Starting code units: 1 a b c
  4943. Last code unit = '3'
  4944. Subject length lower bound = 3
  4945. 123\=ps
  4946. 0: 123
  4947. a\=ps
  4948. Partial match: a
  4949. b\=ps
  4950. Partial match: b
  4951. c\=ps
  4952. Partial match: c
  4953. c12\=ps
  4954. Partial match: c12
  4955. c123\=ps
  4956. 0: c123
  4957. /^(?:\d){3,5}X/I
  4958. Capture group count = 0
  4959. Compile options: <none>
  4960. Overall options: anchored
  4961. Starting code units: 0 1 2 3 4 5 6 7 8 9
  4962. Last code unit = 'X'
  4963. Subject length lower bound = 4
  4964. 1\=ps
  4965. Partial match: 1
  4966. 123\=ps
  4967. Partial match: 123
  4968. 123X
  4969. 0: 123X
  4970. 1234\=ps
  4971. Partial match: 1234
  4972. 1234X
  4973. 0: 1234X
  4974. 12345\=ps
  4975. Partial match: 12345
  4976. 12345X
  4977. 0: 12345X
  4978. \= Expect no match
  4979. 1X
  4980. No match
  4981. 123456\=ps
  4982. No match
  4983. "<(\w+)/?>(.)*</(\1)>"Igms
  4984. Capture group count = 3
  4985. Max back reference = 1
  4986. Options: dotall multiline
  4987. First code unit = '<'
  4988. Last code unit = '>'
  4989. Subject length lower bound = 7
  4990. <!DOCTYPE seite SYSTEM "http://www.lco.lineas.de/xmlCms.dtd">\n<seite>\n<dokumenteninformation>\n<seitentitel>Partner der LCO</seitentitel>\n<sprache>de</sprache>\n<seitenbeschreibung>Partner der LINEAS Consulting\nGmbH</seitenbeschreibung>\n<schluesselworte>LINEAS Consulting GmbH Hamburg\nPartnerfirmen</schluesselworte>\n<revisit>30 days</revisit>\n<robots>index,follow</robots>\n<menueinformation>\n<aktiv>ja</aktiv>\n<menueposition>3</menueposition>\n<menuetext>Partner</menuetext>\n</menueinformation>\n<lastedited>\n<autor>LCO</autor>\n<firma>LINEAS Consulting</firma>\n<datum>15.10.2003</datum>\n</lastedited>\n</dokumenteninformation>\n<inhalt>\n\n<absatzueberschrift>Die Partnerfirmen der LINEAS Consulting\nGmbH</absatzueberschrift>\n\n<absatz><link ziel="http://www.ca.com/" zielfenster="_blank">\n<bild name="logo_ca.gif" rahmen="no"/></link> <link\nziel="http://www.ey.com/" zielfenster="_blank"><bild\nname="logo_euy.gif" rahmen="no"/></link>\n</absatz>\n\n<absatz><link ziel="http://www.cisco.de/" zielfenster="_blank">\n<bild name="logo_cisco.gif" rahmen="ja"/></link></absatz>\n\n<absatz><link ziel="http://www.atelion.de/"\nzielfenster="_blank"><bild\nname="logo_atelion.gif" rahmen="no"/></link>\n</absatz>\n\n<absatz><link ziel="http://www.line-information.de/"\nzielfenster="_blank">\n<bild name="logo_line_information.gif" rahmen="no"/></link>\n</absatz>\n\n<absatz><bild name="logo_aw.gif" rahmen="no"/></absatz>\n\n<absatz><link ziel="http://www.incognis.de/"\nzielfenster="_blank"><bild\nname="logo_incognis.gif" rahmen="no"/></link></absatz>\n\n<absatz><link ziel="http://www.addcraft.com/"\nzielfenster="_blank"><bild\nname="logo_addcraft.gif" rahmen="no"/></link></absatz>\n\n<absatz><link ziel="http://www.comendo.com/"\nzielfenster="_blank"><bild\nname="logo_comendo.gif" rahmen="no"/></link></absatz>\n\n</inhalt>\n</seite>\=jitstack=1024
  4991. 0: <seite>\x0a<dokumenteninformation>\x0a<seitentitel>Partner der LCO</seitentitel>\x0a<sprache>de</sprache>\x0a<seitenbeschreibung>Partner der LINEAS Consulting\x0aGmbH</seitenbeschreibung>\x0a<schluesselworte>LINEAS Consulting GmbH Hamburg\x0aPartnerfirmen</schluesselworte>\x0a<revisit>30 days</revisit>\x0a<robots>index,follow</robots>\x0a<menueinformation>\x0a<aktiv>ja</aktiv>\x0a<menueposition>3</menueposition>\x0a<menuetext>Partner</menuetext>\x0a</menueinformation>\x0a<lastedited>\x0a<autor>LCO</autor>\x0a<firma>LINEAS Consulting</firma>\x0a<datum>15.10.2003</datum>\x0a</lastedited>\x0a</dokumenteninformation>\x0a<inhalt>\x0a\x0a<absatzueberschrift>Die Partnerfirmen der LINEAS Consulting\x0aGmbH</absatzueberschrift>\x0a\x0a<absatz><link ziel="http://www.ca.com/" zielfenster="_blank">\x0a<bild name="logo_ca.gif" rahmen="no"/></link> <link\x0aziel="http://www.ey.com/" zielfenster="_blank"><bild\x0aname="logo_euy.gif" rahmen="no"/></link>\x0a</absatz>\x0a\x0a<absatz><link ziel="http://www.cisco.de/" zielfenster="_blank">\x0a<bild name="logo_cisco.gif" rahmen="ja"/></link></absatz>\x0a\x0a<absatz><link ziel="http://www.atelion.de/"\x0azielfenster="_blank"><bild\x0aname="logo_atelion.gif" rahmen="no"/></link>\x0a</absatz>\x0a\x0a<absatz><link ziel="http://www.line-information.de/"\x0azielfenster="_blank">\x0a<bild name="logo_line_information.gif" rahmen="no"/></link>\x0a</absatz>\x0a\x0a<absatz><bild name="logo_aw.gif" rahmen="no"/></absatz>\x0a\x0a<absatz><link ziel="http://www.incognis.de/"\x0azielfenster="_blank"><bild\x0aname="logo_incognis.gif" rahmen="no"/></link></absatz>\x0a\x0a<absatz><link ziel="http://www.addcraft.com/"\x0azielfenster="_blank"><bild\x0aname="logo_addcraft.gif" rahmen="no"/></link></absatz>\x0a\x0a<absatz><link ziel="http://www.comendo.com/"\x0azielfenster="_blank"><bild\x0aname="logo_comendo.gif" rahmen="no"/></link></absatz>\x0a\x0a</inhalt>\x0a</seite>
  4992. 1: seite
  4993. 2: \x0a
  4994. 3: seite
  4995. /line\nbreak/I
  4996. Capture group count = 0
  4997. Contains explicit CR or LF match
  4998. First code unit = 'l'
  4999. Last code unit = 'k'
  5000. Subject length lower bound = 10
  5001. this is a line\nbreak
  5002. 0: line\x0abreak
  5003. line one\nthis is a line\nbreak in the second line
  5004. 0: line\x0abreak
  5005. /line\nbreak/I,firstline
  5006. Capture group count = 0
  5007. Contains explicit CR or LF match
  5008. Options: firstline
  5009. First code unit = 'l'
  5010. Last code unit = 'k'
  5011. Subject length lower bound = 10
  5012. this is a line\nbreak
  5013. 0: line\x0abreak
  5014. \= Expect no match
  5015. line one\nthis is a line\nbreak in the second line
  5016. No match
  5017. /line\nbreak/Im,firstline
  5018. Capture group count = 0
  5019. Contains explicit CR or LF match
  5020. Options: firstline multiline
  5021. First code unit = 'l'
  5022. Last code unit = 'k'
  5023. Subject length lower bound = 10
  5024. this is a line\nbreak
  5025. 0: line\x0abreak
  5026. \= Expect no match
  5027. line one\nthis is a line\nbreak in the second line
  5028. No match
  5029. /(?i)(?-i)AbCd/I
  5030. Capture group count = 0
  5031. First code unit = 'A'
  5032. Last code unit = 'd'
  5033. Subject length lower bound = 4
  5034. AbCd
  5035. 0: AbCd
  5036. \= Expect no match
  5037. abcd
  5038. No match
  5039. /a{11111111111111111111}/I
  5040. Failed: error 105 at offset 8: number too big in {} quantifier
  5041. /(){64294967295}/I
  5042. Failed: error 105 at offset 9: number too big in {} quantifier
  5043. /(){2,4294967295}/I
  5044. Failed: error 105 at offset 11: number too big in {} quantifier
  5045. "(?i:a)(?i:b)(?i:c)(?i:d)(?i:e)(?i:f)(?i:g)(?i:h)(?i:i)(?i:j)(k)(?i:l)A\1B"I
  5046. Capture group count = 1
  5047. Max back reference = 1
  5048. First code unit = 'a' (caseless)
  5049. Last code unit = 'B'
  5050. Subject length lower bound = 15
  5051. abcdefghijklAkB
  5052. 0: abcdefghijklAkB
  5053. 1: k
  5054. "(?P<n0>a)(?P<n1>b)(?P<n2>c)(?P<n3>d)(?P<n4>e)(?P<n5>f)(?P<n6>g)(?P<n7>h)(?P<n8>i)(?P<n9>j)(?P<n10>k)(?P<n11>l)A\11B"I
  5055. Capture group count = 12
  5056. Max back reference = 11
  5057. Named capture groups:
  5058. n0 1
  5059. n1 2
  5060. n10 11
  5061. n11 12
  5062. n2 3
  5063. n3 4
  5064. n4 5
  5065. n5 6
  5066. n6 7
  5067. n7 8
  5068. n8 9
  5069. n9 10
  5070. First code unit = 'a'
  5071. Last code unit = 'B'
  5072. Subject length lower bound = 15
  5073. abcdefghijklAkB
  5074. 0: abcdefghijklAkB
  5075. 1: a
  5076. 2: b
  5077. 3: c
  5078. 4: d
  5079. 5: e
  5080. 6: f
  5081. 7: g
  5082. 8: h
  5083. 9: i
  5084. 10: j
  5085. 11: k
  5086. 12: l
  5087. "(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)(l)A\11B"I
  5088. Capture group count = 12
  5089. Max back reference = 11
  5090. First code unit = 'a'
  5091. Last code unit = 'B'
  5092. Subject length lower bound = 15
  5093. abcdefghijklAkB
  5094. 0: abcdefghijklAkB
  5095. 1: a
  5096. 2: b
  5097. 3: c
  5098. 4: d
  5099. 5: e
  5100. 6: f
  5101. 7: g
  5102. 8: h
  5103. 9: i
  5104. 10: j
  5105. 11: k
  5106. 12: l
  5107. "(?P<name0>a)(?P<name1>a)(?P<name2>a)(?P<name3>a)(?P<name4>a)(?P<name5>a)(?P<name6>a)(?P<name7>a)(?P<name8>a)(?P<name9>a)(?P<name10>a)(?P<name11>a)(?P<name12>a)(?P<name13>a)(?P<name14>a)(?P<name15>a)(?P<name16>a)(?P<name17>a)(?P<name18>a)(?P<name19>a)(?P<name20>a)(?P<name21>a)(?P<name22>a)(?P<name23>a)(?P<name24>a)(?P<name25>a)(?P<name26>a)(?P<name27>a)(?P<name28>a)(?P<name29>a)(?P<name30>a)(?P<name31>a)(?P<name32>a)(?P<name33>a)(?P<name34>a)(?P<name35>a)(?P<name36>a)(?P<name37>a)(?P<name38>a)(?P<name39>a)(?P<name40>a)(?P<name41>a)(?P<name42>a)(?P<name43>a)(?P<name44>a)(?P<name45>a)(?P<name46>a)(?P<name47>a)(?P<name48>a)(?P<name49>a)(?P<name50>a)(?P<name51>a)(?P<name52>a)(?P<name53>a)(?P<name54>a)(?P<name55>a)(?P<name56>a)(?P<name57>a)(?P<name58>a)(?P<name59>a)(?P<name60>a)(?P<name61>a)(?P<name62>a)(?P<name63>a)(?P<name64>a)(?P<name65>a)(?P<name66>a)(?P<name67>a)(?P<name68>a)(?P<name69>a)(?P<name70>a)(?P<name71>a)(?P<name72>a)(?P<name73>a)(?P<name74>a)(?P<name75>a)(?P<name76>a)(?P<name77>a)(?P<name78>a)(?P<name79>a)(?P<name80>a)(?P<name81>a)(?P<name82>a)(?P<name83>a)(?P<name84>a)(?P<name85>a)(?P<name86>a)(?P<name87>a)(?P<name88>a)(?P<name89>a)(?P<name90>a)(?P<name91>a)(?P<name92>a)(?P<name93>a)(?P<name94>a)(?P<name95>a)(?P<name96>a)(?P<name97>a)(?P<name98>a)(?P<name99>a)(?P<name100>a)"I
  5108. Capture group count = 101
  5109. Named capture groups:
  5110. name0 1
  5111. name1 2
  5112. name10 11
  5113. name100 101
  5114. name11 12
  5115. name12 13
  5116. name13 14
  5117. name14 15
  5118. name15 16
  5119. name16 17
  5120. name17 18
  5121. name18 19
  5122. name19 20
  5123. name2 3
  5124. name20 21
  5125. name21 22
  5126. name22 23
  5127. name23 24
  5128. name24 25
  5129. name25 26
  5130. name26 27
  5131. name27 28
  5132. name28 29
  5133. name29 30
  5134. name3 4
  5135. name30 31
  5136. name31 32
  5137. name32 33
  5138. name33 34
  5139. name34 35
  5140. name35 36
  5141. name36 37
  5142. name37 38
  5143. name38 39
  5144. name39 40
  5145. name4 5
  5146. name40 41
  5147. name41 42
  5148. name42 43
  5149. name43 44
  5150. name44 45
  5151. name45 46
  5152. name46 47
  5153. name47 48
  5154. name48 49
  5155. name49 50
  5156. name5 6
  5157. name50 51
  5158. name51 52
  5159. name52 53
  5160. name53 54
  5161. name54 55
  5162. name55 56
  5163. name56 57
  5164. name57 58
  5165. name58 59
  5166. name59 60
  5167. name6 7
  5168. name60 61
  5169. name61 62
  5170. name62 63
  5171. name63 64
  5172. name64 65
  5173. name65 66
  5174. name66 67
  5175. name67 68
  5176. name68 69
  5177. name69 70
  5178. name7 8
  5179. name70 71
  5180. name71 72
  5181. name72 73
  5182. name73 74
  5183. name74 75
  5184. name75 76
  5185. name76 77
  5186. name77 78
  5187. name78 79
  5188. name79 80
  5189. name8 9
  5190. name80 81
  5191. name81 82
  5192. name82 83
  5193. name83 84
  5194. name84 85
  5195. name85 86
  5196. name86 87
  5197. name87 88
  5198. name88 89
  5199. name89 90
  5200. name9 10
  5201. name90 91
  5202. name91 92
  5203. name92 93
  5204. name93 94
  5205. name94 95
  5206. name95 96
  5207. name96 97
  5208. name97 98
  5209. name98 99
  5210. name99 100
  5211. First code unit = 'a'
  5212. Last code unit = 'a'
  5213. Subject length lower bound = 101
  5214. aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
  5215. Matched, but too many substrings
  5216. 0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
  5217. 1: a
  5218. 2: a
  5219. 3: a
  5220. 4: a
  5221. 5: a
  5222. 6: a
  5223. 7: a
  5224. 8: a
  5225. 9: a
  5226. 10: a
  5227. 11: a
  5228. 12: a
  5229. 13: a
  5230. 14: a
  5231. "(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)"I
  5232. Capture group count = 101
  5233. First code unit = 'a'
  5234. Last code unit = 'a'
  5235. Subject length lower bound = 101
  5236. aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
  5237. Matched, but too many substrings
  5238. 0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
  5239. 1: a
  5240. 2: a
  5241. 3: a
  5242. 4: a
  5243. 5: a
  5244. 6: a
  5245. 7: a
  5246. 8: a
  5247. 9: a
  5248. 10: a
  5249. 11: a
  5250. 12: a
  5251. 13: a
  5252. 14: a
  5253. /[^()]*(?:\((?R)\)[^()]*)*/I
  5254. Capture group count = 0
  5255. May match empty string
  5256. Subject length lower bound = 0
  5257. (this(and)that
  5258. 0:
  5259. (this(and)that)
  5260. 0: (this(and)that)
  5261. (this(and)that)stuff
  5262. 0: (this(and)that)stuff
  5263. /[^()]*(?:\((?>(?R))\)[^()]*)*/I
  5264. Capture group count = 0
  5265. May match empty string
  5266. Subject length lower bound = 0
  5267. (this(and)that
  5268. 0:
  5269. (this(and)that)
  5270. 0: (this(and)that)
  5271. /[^()]*(?:\((?R)\))*[^()]*/I
  5272. Capture group count = 0
  5273. May match empty string
  5274. Subject length lower bound = 0
  5275. (this(and)that
  5276. 0:
  5277. (this(and)that)
  5278. 0: (this(and)that)
  5279. /(?:\((?R)\))*[^()]*/I
  5280. Capture group count = 0
  5281. May match empty string
  5282. Subject length lower bound = 0
  5283. (this(and)that
  5284. 0:
  5285. (this(and)that)
  5286. 0:
  5287. ((this))
  5288. 0: ((this))
  5289. /(?:\((?R)\))|[^()]*/I
  5290. Capture group count = 0
  5291. May match empty string
  5292. Subject length lower bound = 0
  5293. (this(and)that
  5294. 0:
  5295. (this(and)that)
  5296. 0:
  5297. (this)
  5298. 0: (this)
  5299. ((this))
  5300. 0: ((this))
  5301. /\x{0000ff}/I
  5302. Capture group count = 0
  5303. First code unit = \xff
  5304. Subject length lower bound = 1
  5305. /^((?P<A>a1)|(?P<A>a2)b)/I
  5306. Failed: error 143 at offset 18: two named subpatterns have the same name (PCRE2_DUPNAMES not set)
  5307. /^((?P<A>a1)|(?P<A>a2)b)/I,dupnames
  5308. Capture group count = 3
  5309. Named capture groups:
  5310. A 2
  5311. A 3
  5312. Compile options: dupnames
  5313. Overall options: anchored dupnames
  5314. First code unit = 'a'
  5315. Subject length lower bound = 2
  5316. a1b\=copy=A
  5317. 0: a1
  5318. 1: a1
  5319. 2: a1
  5320. C a1 (2) A (non-unique)
  5321. a2b\=copy=A
  5322. 0: a2b
  5323. 1: a2b
  5324. 2: <unset>
  5325. 3: a2
  5326. C a2 (2) A (non-unique)
  5327. a1b\=copy=Z,copy=A
  5328. 0: a1
  5329. 1: a1
  5330. 2: a1
  5331. Number not found for group 'Z'
  5332. Copy substring 'Z' failed (-49): unknown substring
  5333. C a1 (2) A (non-unique)
  5334. /(?|(?<a>)(?<b>)(?<a>)|(?<a>)(?<b>)(?<a>))/I,dupnames
  5335. Capture group count = 3
  5336. Named capture groups:
  5337. a 1
  5338. a 3
  5339. b 2
  5340. May match empty string
  5341. Options: dupnames
  5342. Subject length lower bound = 0
  5343. /^(?P<A>a)(?P<A>b)/I,dupnames
  5344. Capture group count = 2
  5345. Named capture groups:
  5346. A 1
  5347. A 2
  5348. Compile options: dupnames
  5349. Overall options: anchored dupnames
  5350. First code unit = 'a'
  5351. Subject length lower bound = 2
  5352. ab\=copy=A
  5353. 0: ab
  5354. 1: a
  5355. 2: b
  5356. C a (1) A (non-unique)
  5357. /^(?P<A>a)(?P<A>b)|cd/I,dupnames
  5358. Capture group count = 2
  5359. Named capture groups:
  5360. A 1
  5361. A 2
  5362. Options: dupnames
  5363. Starting code units: a c
  5364. Subject length lower bound = 2
  5365. ab\=copy=A
  5366. 0: ab
  5367. 1: a
  5368. 2: b
  5369. C a (1) A (non-unique)
  5370. cd\=copy=A
  5371. 0: cd
  5372. Copy substring 'A' failed (-55): requested value is not set
  5373. /^(?P<A>a)(?P<A>b)|cd(?P<A>ef)(?P<A>gh)/I,dupnames
  5374. Capture group count = 4
  5375. Named capture groups:
  5376. A 1
  5377. A 2
  5378. A 3
  5379. A 4
  5380. Options: dupnames
  5381. Starting code units: a c
  5382. Subject length lower bound = 2
  5383. cdefgh\=copy=A
  5384. 0: cdefgh
  5385. 1: <unset>
  5386. 2: <unset>
  5387. 3: ef
  5388. 4: gh
  5389. C ef (2) A (non-unique)
  5390. /^((?P<A>a1)|(?P<A>a2)b)/I,dupnames
  5391. Capture group count = 3
  5392. Named capture groups:
  5393. A 2
  5394. A 3
  5395. Compile options: dupnames
  5396. Overall options: anchored dupnames
  5397. First code unit = 'a'
  5398. Subject length lower bound = 2
  5399. a1b\=get=A
  5400. 0: a1
  5401. 1: a1
  5402. 2: a1
  5403. G a1 (2) A (non-unique)
  5404. a2b\=get=A
  5405. 0: a2b
  5406. 1: a2b
  5407. 2: <unset>
  5408. 3: a2
  5409. G a2 (2) A (non-unique)
  5410. a1b\=get=Z,get=A
  5411. 0: a1
  5412. 1: a1
  5413. 2: a1
  5414. Number not found for group 'Z'
  5415. Get substring 'Z' failed (-49): unknown substring
  5416. G a1 (2) A (non-unique)
  5417. /^(?P<A>a)(?P<A>b)/I,dupnames
  5418. Capture group count = 2
  5419. Named capture groups:
  5420. A 1
  5421. A 2
  5422. Compile options: dupnames
  5423. Overall options: anchored dupnames
  5424. First code unit = 'a'
  5425. Subject length lower bound = 2
  5426. ab\=get=A
  5427. 0: ab
  5428. 1: a
  5429. 2: b
  5430. G a (1) A (non-unique)
  5431. /^(?P<A>a)(?P<A>b)|cd/I,dupnames
  5432. Capture group count = 2
  5433. Named capture groups:
  5434. A 1
  5435. A 2
  5436. Options: dupnames
  5437. Starting code units: a c
  5438. Subject length lower bound = 2
  5439. ab\=get=A
  5440. 0: ab
  5441. 1: a
  5442. 2: b
  5443. G a (1) A (non-unique)
  5444. cd\=get=A
  5445. 0: cd
  5446. Get substring 'A' failed (-55): requested value is not set
  5447. /^(?P<A>a)(?P<A>b)|cd(?P<A>ef)(?P<A>gh)/I,dupnames
  5448. Capture group count = 4
  5449. Named capture groups:
  5450. A 1
  5451. A 2
  5452. A 3
  5453. A 4
  5454. Options: dupnames
  5455. Starting code units: a c
  5456. Subject length lower bound = 2
  5457. cdefgh\=get=A
  5458. 0: cdefgh
  5459. 1: <unset>
  5460. 2: <unset>
  5461. 3: ef
  5462. 4: gh
  5463. G ef (2) A (non-unique)
  5464. /(?J)^((?P<A>a1)|(?P<A>a2)b)/I
  5465. Capture group count = 3
  5466. Named capture groups:
  5467. A 2
  5468. A 3
  5469. Compile options: <none>
  5470. Overall options: anchored
  5471. Duplicate name status changes
  5472. First code unit = 'a'
  5473. Subject length lower bound = 2
  5474. a1b\=copy=A
  5475. 0: a1
  5476. 1: a1
  5477. 2: a1
  5478. C a1 (2) A (non-unique)
  5479. a2b\=copy=A
  5480. 0: a2b
  5481. 1: a2b
  5482. 2: <unset>
  5483. 3: a2
  5484. C a2 (2) A (non-unique)
  5485. /^(?P<A>a) (?J:(?P<B>b)(?P<B>c)) (?P<A>d)/I
  5486. Failed: error 143 at offset 38: two named subpatterns have the same name (PCRE2_DUPNAMES not set)
  5487. # In this next test, J is not set at the outer level; consequently it isn't set
  5488. # in the pattern's options; consequently pcre2_substring_get_byname() produces
  5489. # a random value.
  5490. /^(?P<A>a) (?J:(?P<B>b)(?P<B>c)) (?P<C>d)/I
  5491. Capture group count = 4
  5492. Named capture groups:
  5493. A 1
  5494. B 2
  5495. B 3
  5496. C 4
  5497. Compile options: <none>
  5498. Overall options: anchored
  5499. Duplicate name status changes
  5500. First code unit = 'a'
  5501. Subject length lower bound = 6
  5502. a bc d\=copy=A,copy=B,copy=C
  5503. 0: a bc d
  5504. 1: a
  5505. 2: b
  5506. 3: c
  5507. 4: d
  5508. C a (1) A (group 1)
  5509. C b (1) B (non-unique)
  5510. C d (1) C (group 4)
  5511. /^(?P<A>a)?(?(A)a|b)/I
  5512. Capture group count = 1
  5513. Max back reference = 1
  5514. Named capture groups:
  5515. A 1
  5516. Compile options: <none>
  5517. Overall options: anchored
  5518. Subject length lower bound = 1
  5519. aabc
  5520. 0: aa
  5521. 1: a
  5522. bc
  5523. 0: b
  5524. \= Expect no match
  5525. abc
  5526. No match
  5527. /(?:(?(ZZ)a|b)(?P<ZZ>X))+/I
  5528. Capture group count = 1
  5529. Max back reference = 1
  5530. Named capture groups:
  5531. ZZ 1
  5532. Last code unit = 'X'
  5533. Subject length lower bound = 2
  5534. bXaX
  5535. 0: bXaX
  5536. 1: X
  5537. /(?:(?(2y)a|b)(X))+/I
  5538. Failed: error 124 at offset 7: missing closing parenthesis for condition
  5539. /(?:(?(ZA)a|b)(?P<ZZ>X))+/I
  5540. Failed: error 115 at offset 6: reference to non-existent subpattern
  5541. /(?:(?(ZZ)a|b)(?(ZZ)a|b)(?P<ZZ>X))+/I
  5542. Capture group count = 1
  5543. Max back reference = 1
  5544. Named capture groups:
  5545. ZZ 1
  5546. Last code unit = 'X'
  5547. Subject length lower bound = 3
  5548. bbXaaX
  5549. 0: bbXaaX
  5550. 1: X
  5551. /(?:(?(ZZ)a|\(b\))\\(?P<ZZ>X))+/I
  5552. Capture group count = 1
  5553. Max back reference = 1
  5554. Named capture groups:
  5555. ZZ 1
  5556. Last code unit = 'X'
  5557. Subject length lower bound = 3
  5558. (b)\\Xa\\X
  5559. 0: (b)\Xa\X
  5560. 1: X
  5561. /(?P<ABC/I
  5562. Failed: error 142 at offset 7: syntax error in subpattern name (missing terminator?)
  5563. /(?:(?(A)(?P=A)a|b)(?P<A>X|Y))+/I
  5564. Capture group count = 1
  5565. Max back reference = 1
  5566. Named capture groups:
  5567. A 1
  5568. Subject length lower bound = 2
  5569. bXXaYYaY
  5570. 0: bXXaYYaY
  5571. 1: Y
  5572. bXYaXXaX
  5573. 0: bX
  5574. 1: X
  5575. /()()()()()()()()()(?:(?(A)(?P=A)a|b)(?P<A>X|Y))+/I
  5576. Capture group count = 10
  5577. Max back reference = 10
  5578. Named capture groups:
  5579. A 10
  5580. Subject length lower bound = 2
  5581. bXXaYYaY
  5582. 0: bXXaYYaY
  5583. 1:
  5584. 2:
  5585. 3:
  5586. 4:
  5587. 5:
  5588. 6:
  5589. 7:
  5590. 8:
  5591. 9:
  5592. 10: Y
  5593. /\s*,\s*/I
  5594. Capture group count = 0
  5595. Starting code units: \x09 \x0a \x0b \x0c \x0d \x20 ,
  5596. Last code unit = ','
  5597. Subject length lower bound = 1
  5598. \x0b,\x0b
  5599. 0: \x0b,\x0b
  5600. \x0c,\x0d
  5601. 0: \x0c,\x0d
  5602. /^abc/Im,newline=lf
  5603. Capture group count = 0
  5604. Options: multiline
  5605. Forced newline is LF
  5606. First code unit at start or follows newline
  5607. Last code unit = 'c'
  5608. Subject length lower bound = 3
  5609. xyz\nabc
  5610. 0: abc
  5611. xyz\r\nabc
  5612. 0: abc
  5613. \= Expect no match
  5614. xyz\rabc
  5615. No match
  5616. xyzabc\r
  5617. No match
  5618. xyzabc\rpqr
  5619. No match
  5620. xyzabc\r\n
  5621. No match
  5622. xyzabc\r\npqr
  5623. No match
  5624. /^abc/Im,newline=crlf
  5625. Capture group count = 0
  5626. Options: multiline
  5627. Forced newline is CRLF
  5628. First code unit at start or follows newline
  5629. Last code unit = 'c'
  5630. Subject length lower bound = 3
  5631. xyz\r\nabclf>
  5632. 0: abc
  5633. \= Expect no match
  5634. xyz\nabclf
  5635. No match
  5636. xyz\rabclf
  5637. No match
  5638. /^abc/Im,newline=cr
  5639. Capture group count = 0
  5640. Options: multiline
  5641. Forced newline is CR
  5642. First code unit at start or follows newline
  5643. Last code unit = 'c'
  5644. Subject length lower bound = 3
  5645. xyz\rabc
  5646. 0: abc
  5647. \= Expect no match
  5648. xyz\nabc
  5649. No match
  5650. xyz\r\nabc
  5651. No match
  5652. /^abc/Im,newline=bad
  5653. ** Invalid value in 'newline=bad'
  5654. /.*/I,newline=lf
  5655. Capture group count = 0
  5656. May match empty string
  5657. Forced newline is LF
  5658. First code unit at start or follows newline
  5659. Subject length lower bound = 0
  5660. abc\ndef
  5661. 0: abc
  5662. abc\rdef
  5663. 0: abc\x0ddef
  5664. abc\r\ndef
  5665. 0: abc\x0d
  5666. /.*/I,newline=cr
  5667. Capture group count = 0
  5668. May match empty string
  5669. Forced newline is CR
  5670. First code unit at start or follows newline
  5671. Subject length lower bound = 0
  5672. abc\ndef
  5673. 0: abc\x0adef
  5674. abc\rdef
  5675. 0: abc
  5676. abc\r\ndef
  5677. 0: abc
  5678. /.*/I,newline=crlf
  5679. Capture group count = 0
  5680. May match empty string
  5681. Forced newline is CRLF
  5682. First code unit at start or follows newline
  5683. Subject length lower bound = 0
  5684. abc\ndef
  5685. 0: abc\x0adef
  5686. abc\rdef
  5687. 0: abc\x0ddef
  5688. abc\r\ndef
  5689. 0: abc
  5690. /\w+(.)(.)?def/Is
  5691. Capture group count = 2
  5692. Options: dotall
  5693. Starting code units: 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P
  5694. Q R S T U V W X Y Z _ a b c d e f g h i j k l m n o p q r s t u v w x y z
  5695. Last code unit = 'f'
  5696. Subject length lower bound = 5
  5697. abc\ndef
  5698. 0: abc\x0adef
  5699. 1: \x0a
  5700. abc\rdef
  5701. 0: abc\x0ddef
  5702. 1: \x0d
  5703. abc\r\ndef
  5704. 0: abc\x0d\x0adef
  5705. 1: \x0d
  5706. 2: \x0a
  5707. /(?P<B>25[0-5]|2[0-4]\d|[01]?\d?\d)(?:\.(?P>B)){3}/I
  5708. Capture group count = 1
  5709. Named capture groups:
  5710. B 1
  5711. Starting code units: 0 1 2 3 4 5 6 7 8 9
  5712. Last code unit = '.'
  5713. Subject length lower bound = 7
  5714. /()()()()()()()()()()()()()()()()()()()()
  5715. ()()()()()()()()()()()()()()()()()()()()
  5716. ()()()()()()()()()()()()()()()()()()()()
  5717. ()()()()()()()()()()()()()()()()()()()()
  5718. ()()()()()()()()()()()()()()()()()()()()
  5719. (.(.))/Ix
  5720. Capture group count = 102
  5721. Options: extended
  5722. Subject length lower bound = 2
  5723. XY\=ovector=133
  5724. 0: XY
  5725. 1:
  5726. 2:
  5727. 3:
  5728. 4:
  5729. 5:
  5730. 6:
  5731. 7:
  5732. 8:
  5733. 9:
  5734. 10:
  5735. 11:
  5736. 12:
  5737. 13:
  5738. 14:
  5739. 15:
  5740. 16:
  5741. 17:
  5742. 18:
  5743. 19:
  5744. 20:
  5745. 21:
  5746. 22:
  5747. 23:
  5748. 24:
  5749. 25:
  5750. 26:
  5751. 27:
  5752. 28:
  5753. 29:
  5754. 30:
  5755. 31:
  5756. 32:
  5757. 33:
  5758. 34:
  5759. 35:
  5760. 36:
  5761. 37:
  5762. 38:
  5763. 39:
  5764. 40:
  5765. 41:
  5766. 42:
  5767. 43:
  5768. 44:
  5769. 45:
  5770. 46:
  5771. 47:
  5772. 48:
  5773. 49:
  5774. 50:
  5775. 51:
  5776. 52:
  5777. 53:
  5778. 54:
  5779. 55:
  5780. 56:
  5781. 57:
  5782. 58:
  5783. 59:
  5784. 60:
  5785. 61:
  5786. 62:
  5787. 63:
  5788. 64:
  5789. 65:
  5790. 66:
  5791. 67:
  5792. 68:
  5793. 69:
  5794. 70:
  5795. 71:
  5796. 72:
  5797. 73:
  5798. 74:
  5799. 75:
  5800. 76:
  5801. 77:
  5802. 78:
  5803. 79:
  5804. 80:
  5805. 81:
  5806. 82:
  5807. 83:
  5808. 84:
  5809. 85:
  5810. 86:
  5811. 87:
  5812. 88:
  5813. 89:
  5814. 90:
  5815. 91:
  5816. 92:
  5817. 93:
  5818. 94:
  5819. 95:
  5820. 96:
  5821. 97:
  5822. 98:
  5823. 99:
  5824. 100:
  5825. 101: XY
  5826. 102: Y
  5827. /(a*b|(?i:c*(?-i)d))/I
  5828. Capture group count = 1
  5829. Starting code units: C a b c d
  5830. Subject length lower bound = 1
  5831. /()[ab]xyz/I
  5832. Capture group count = 1
  5833. Starting code units: a b
  5834. Last code unit = 'z'
  5835. Subject length lower bound = 4
  5836. /(|)[ab]xyz/I
  5837. Capture group count = 1
  5838. Starting code units: a b
  5839. Last code unit = 'z'
  5840. Subject length lower bound = 4
  5841. /(|c)[ab]xyz/I
  5842. Capture group count = 1
  5843. Starting code units: a b c
  5844. Last code unit = 'z'
  5845. Subject length lower bound = 4
  5846. /(|c?)[ab]xyz/I
  5847. Capture group count = 1
  5848. Starting code units: a b c
  5849. Last code unit = 'z'
  5850. Subject length lower bound = 4
  5851. /(d?|c?)[ab]xyz/I
  5852. Capture group count = 1
  5853. Starting code units: a b c d
  5854. Last code unit = 'z'
  5855. Subject length lower bound = 4
  5856. /(d?|c)[ab]xyz/I
  5857. Capture group count = 1
  5858. Starting code units: a b c d
  5859. Last code unit = 'z'
  5860. Subject length lower bound = 4
  5861. /^a*b\d/IB
  5862. ------------------------------------------------------------------
  5863. Bra
  5864. ^
  5865. a*+
  5866. b
  5867. \d
  5868. Ket
  5869. End
  5870. ------------------------------------------------------------------
  5871. Capture group count = 0
  5872. Compile options: <none>
  5873. Overall options: anchored
  5874. Starting code units: a b
  5875. Last code unit = 'b'
  5876. Subject length lower bound = 2
  5877. /^a*+b\d/IB
  5878. ------------------------------------------------------------------
  5879. Bra
  5880. ^
  5881. a*+
  5882. b
  5883. \d
  5884. Ket
  5885. End
  5886. ------------------------------------------------------------------
  5887. Capture group count = 0
  5888. Compile options: <none>
  5889. Overall options: anchored
  5890. Starting code units: a b
  5891. Last code unit = 'b'
  5892. Subject length lower bound = 2
  5893. /^a*?b\d/IB
  5894. ------------------------------------------------------------------
  5895. Bra
  5896. ^
  5897. a*+
  5898. b
  5899. \d
  5900. Ket
  5901. End
  5902. ------------------------------------------------------------------
  5903. Capture group count = 0
  5904. Compile options: <none>
  5905. Overall options: anchored
  5906. Starting code units: a b
  5907. Last code unit = 'b'
  5908. Subject length lower bound = 2
  5909. /^a+A\d/IB
  5910. ------------------------------------------------------------------
  5911. Bra
  5912. ^
  5913. a++
  5914. A
  5915. \d
  5916. Ket
  5917. End
  5918. ------------------------------------------------------------------
  5919. Capture group count = 0
  5920. Compile options: <none>
  5921. Overall options: anchored
  5922. First code unit = 'a'
  5923. Last code unit = 'A'
  5924. Subject length lower bound = 3
  5925. aaaA5
  5926. 0: aaaA5
  5927. \= Expect no match
  5928. aaaa5
  5929. No match
  5930. /^a*A\d/IBi
  5931. ------------------------------------------------------------------
  5932. Bra
  5933. ^
  5934. /i a*
  5935. /i A
  5936. \d
  5937. Ket
  5938. End
  5939. ------------------------------------------------------------------
  5940. Capture group count = 0
  5941. Compile options: caseless
  5942. Overall options: anchored caseless
  5943. Starting code units: A a
  5944. Last code unit = 'A' (caseless)
  5945. Subject length lower bound = 2
  5946. aaaA5
  5947. 0: aaaA5
  5948. aaaa5
  5949. 0: aaaa5
  5950. a5
  5951. 0: a5
  5952. /(a*|b*)[cd]/I
  5953. Capture group count = 1
  5954. Starting code units: a b c d
  5955. Subject length lower bound = 1
  5956. /(a+|b*)[cd]/I
  5957. Capture group count = 1
  5958. Starting code units: a b c d
  5959. Subject length lower bound = 1
  5960. /(a*|b+)[cd]/I
  5961. Capture group count = 1
  5962. Starting code units: a b c d
  5963. Subject length lower bound = 1
  5964. /(a+|b+)[cd]/I
  5965. Capture group count = 1
  5966. Starting code units: a b
  5967. Subject length lower bound = 2
  5968. /((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
  5969. ((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
  5970. (((
  5971. a
  5972. ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
  5973. ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
  5974. )))
  5975. /Ix
  5976. Capture group count = 203
  5977. Options: extended
  5978. First code unit = 'a'
  5979. Subject length lower bound = 1
  5980. large nest
  5981. Matched, but too many substrings
  5982. 0: a
  5983. 1: a
  5984. 2: a
  5985. 3: a
  5986. 4: a
  5987. 5: a
  5988. 6: a
  5989. 7: a
  5990. 8: a
  5991. 9: a
  5992. 10: a
  5993. 11: a
  5994. 12: a
  5995. 13: a
  5996. 14: a
  5997. /a*\d/B
  5998. ------------------------------------------------------------------
  5999. Bra
  6000. a*+
  6001. \d
  6002. Ket
  6003. End
  6004. ------------------------------------------------------------------
  6005. /a*\D/B
  6006. ------------------------------------------------------------------
  6007. Bra
  6008. a*
  6009. \D
  6010. Ket
  6011. End
  6012. ------------------------------------------------------------------
  6013. /0*\d/B
  6014. ------------------------------------------------------------------
  6015. Bra
  6016. 0*
  6017. \d
  6018. Ket
  6019. End
  6020. ------------------------------------------------------------------
  6021. /0*\D/B
  6022. ------------------------------------------------------------------
  6023. Bra
  6024. 0*+
  6025. \D
  6026. Ket
  6027. End
  6028. ------------------------------------------------------------------
  6029. /a*\s/B
  6030. ------------------------------------------------------------------
  6031. Bra
  6032. a*+
  6033. \s
  6034. Ket
  6035. End
  6036. ------------------------------------------------------------------
  6037. /a*\S/B
  6038. ------------------------------------------------------------------
  6039. Bra
  6040. a*
  6041. \S
  6042. Ket
  6043. End
  6044. ------------------------------------------------------------------
  6045. / *\s/B
  6046. ------------------------------------------------------------------
  6047. Bra
  6048. *
  6049. \s
  6050. Ket
  6051. End
  6052. ------------------------------------------------------------------
  6053. / *\S/B
  6054. ------------------------------------------------------------------
  6055. Bra
  6056. *+
  6057. \S
  6058. Ket
  6059. End
  6060. ------------------------------------------------------------------
  6061. /a*\w/B
  6062. ------------------------------------------------------------------
  6063. Bra
  6064. a*
  6065. \w
  6066. Ket
  6067. End
  6068. ------------------------------------------------------------------
  6069. /a*\W/B
  6070. ------------------------------------------------------------------
  6071. Bra
  6072. a*+
  6073. \W
  6074. Ket
  6075. End
  6076. ------------------------------------------------------------------
  6077. /=*\w/B
  6078. ------------------------------------------------------------------
  6079. Bra
  6080. =*+
  6081. \w
  6082. Ket
  6083. End
  6084. ------------------------------------------------------------------
  6085. /=*\W/B
  6086. ------------------------------------------------------------------
  6087. Bra
  6088. =*
  6089. \W
  6090. Ket
  6091. End
  6092. ------------------------------------------------------------------
  6093. /\d*a/B
  6094. ------------------------------------------------------------------
  6095. Bra
  6096. \d*+
  6097. a
  6098. Ket
  6099. End
  6100. ------------------------------------------------------------------
  6101. /\d*2/B
  6102. ------------------------------------------------------------------
  6103. Bra
  6104. \d*
  6105. 2
  6106. Ket
  6107. End
  6108. ------------------------------------------------------------------
  6109. /\d*\d/B
  6110. ------------------------------------------------------------------
  6111. Bra
  6112. \d*
  6113. \d
  6114. Ket
  6115. End
  6116. ------------------------------------------------------------------
  6117. /\d*\D/B
  6118. ------------------------------------------------------------------
  6119. Bra
  6120. \d*+
  6121. \D
  6122. Ket
  6123. End
  6124. ------------------------------------------------------------------
  6125. /\d*\s/B
  6126. ------------------------------------------------------------------
  6127. Bra
  6128. \d*+
  6129. \s
  6130. Ket
  6131. End
  6132. ------------------------------------------------------------------
  6133. /\d*\S/B
  6134. ------------------------------------------------------------------
  6135. Bra
  6136. \d*
  6137. \S
  6138. Ket
  6139. End
  6140. ------------------------------------------------------------------
  6141. /\d*\w/B
  6142. ------------------------------------------------------------------
  6143. Bra
  6144. \d*
  6145. \w
  6146. Ket
  6147. End
  6148. ------------------------------------------------------------------
  6149. /\d*\W/B
  6150. ------------------------------------------------------------------
  6151. Bra
  6152. \d*+
  6153. \W
  6154. Ket
  6155. End
  6156. ------------------------------------------------------------------
  6157. /\D*a/B
  6158. ------------------------------------------------------------------
  6159. Bra
  6160. \D*
  6161. a
  6162. Ket
  6163. End
  6164. ------------------------------------------------------------------
  6165. /\D*2/B
  6166. ------------------------------------------------------------------
  6167. Bra
  6168. \D*+
  6169. 2
  6170. Ket
  6171. End
  6172. ------------------------------------------------------------------
  6173. /\D*\d/B
  6174. ------------------------------------------------------------------
  6175. Bra
  6176. \D*+
  6177. \d
  6178. Ket
  6179. End
  6180. ------------------------------------------------------------------
  6181. /\D*\D/B
  6182. ------------------------------------------------------------------
  6183. Bra
  6184. \D*
  6185. \D
  6186. Ket
  6187. End
  6188. ------------------------------------------------------------------
  6189. /\D*\s/B
  6190. ------------------------------------------------------------------
  6191. Bra
  6192. \D*
  6193. \s
  6194. Ket
  6195. End
  6196. ------------------------------------------------------------------
  6197. /\D*\S/B
  6198. ------------------------------------------------------------------
  6199. Bra
  6200. \D*
  6201. \S
  6202. Ket
  6203. End
  6204. ------------------------------------------------------------------
  6205. /\D*\w/B
  6206. ------------------------------------------------------------------
  6207. Bra
  6208. \D*
  6209. \w
  6210. Ket
  6211. End
  6212. ------------------------------------------------------------------
  6213. /\D*\W/B
  6214. ------------------------------------------------------------------
  6215. Bra
  6216. \D*
  6217. \W
  6218. Ket
  6219. End
  6220. ------------------------------------------------------------------
  6221. /\s*a/B
  6222. ------------------------------------------------------------------
  6223. Bra
  6224. \s*+
  6225. a
  6226. Ket
  6227. End
  6228. ------------------------------------------------------------------
  6229. /\s*2/B
  6230. ------------------------------------------------------------------
  6231. Bra
  6232. \s*+
  6233. 2
  6234. Ket
  6235. End
  6236. ------------------------------------------------------------------
  6237. /\s*\d/B
  6238. ------------------------------------------------------------------
  6239. Bra
  6240. \s*+
  6241. \d
  6242. Ket
  6243. End
  6244. ------------------------------------------------------------------
  6245. /\s*\D/B
  6246. ------------------------------------------------------------------
  6247. Bra
  6248. \s*
  6249. \D
  6250. Ket
  6251. End
  6252. ------------------------------------------------------------------
  6253. /\s*\s/B
  6254. ------------------------------------------------------------------
  6255. Bra
  6256. \s*
  6257. \s
  6258. Ket
  6259. End
  6260. ------------------------------------------------------------------
  6261. /\s*\S/B
  6262. ------------------------------------------------------------------
  6263. Bra
  6264. \s*+
  6265. \S
  6266. Ket
  6267. End
  6268. ------------------------------------------------------------------
  6269. /\s*\w/B
  6270. ------------------------------------------------------------------
  6271. Bra
  6272. \s*+
  6273. \w
  6274. Ket
  6275. End
  6276. ------------------------------------------------------------------
  6277. /\s*\W/B
  6278. ------------------------------------------------------------------
  6279. Bra
  6280. \s*
  6281. \W
  6282. Ket
  6283. End
  6284. ------------------------------------------------------------------
  6285. /\S*a/B
  6286. ------------------------------------------------------------------
  6287. Bra
  6288. \S*
  6289. a
  6290. Ket
  6291. End
  6292. ------------------------------------------------------------------
  6293. /\S*2/B
  6294. ------------------------------------------------------------------
  6295. Bra
  6296. \S*
  6297. 2
  6298. Ket
  6299. End
  6300. ------------------------------------------------------------------
  6301. /\S*\d/B
  6302. ------------------------------------------------------------------
  6303. Bra
  6304. \S*
  6305. \d
  6306. Ket
  6307. End
  6308. ------------------------------------------------------------------
  6309. /\S*\D/B
  6310. ------------------------------------------------------------------
  6311. Bra
  6312. \S*
  6313. \D
  6314. Ket
  6315. End
  6316. ------------------------------------------------------------------
  6317. /\S*\s/B
  6318. ------------------------------------------------------------------
  6319. Bra
  6320. \S*+
  6321. \s
  6322. Ket
  6323. End
  6324. ------------------------------------------------------------------
  6325. /\S*\S/B
  6326. ------------------------------------------------------------------
  6327. Bra
  6328. \S*
  6329. \S
  6330. Ket
  6331. End
  6332. ------------------------------------------------------------------
  6333. /\S*\w/B
  6334. ------------------------------------------------------------------
  6335. Bra
  6336. \S*
  6337. \w
  6338. Ket
  6339. End
  6340. ------------------------------------------------------------------
  6341. /\S*\W/B
  6342. ------------------------------------------------------------------
  6343. Bra
  6344. \S*
  6345. \W
  6346. Ket
  6347. End
  6348. ------------------------------------------------------------------
  6349. /\w*a/B
  6350. ------------------------------------------------------------------
  6351. Bra
  6352. \w*
  6353. a
  6354. Ket
  6355. End
  6356. ------------------------------------------------------------------
  6357. /\w*2/B
  6358. ------------------------------------------------------------------
  6359. Bra
  6360. \w*
  6361. 2
  6362. Ket
  6363. End
  6364. ------------------------------------------------------------------
  6365. /\w*\d/B
  6366. ------------------------------------------------------------------
  6367. Bra
  6368. \w*
  6369. \d
  6370. Ket
  6371. End
  6372. ------------------------------------------------------------------
  6373. /\w*\D/B
  6374. ------------------------------------------------------------------
  6375. Bra
  6376. \w*
  6377. \D
  6378. Ket
  6379. End
  6380. ------------------------------------------------------------------
  6381. /\w*\s/B
  6382. ------------------------------------------------------------------
  6383. Bra
  6384. \w*+
  6385. \s
  6386. Ket
  6387. End
  6388. ------------------------------------------------------------------
  6389. /\w*\S/B
  6390. ------------------------------------------------------------------
  6391. Bra
  6392. \w*
  6393. \S
  6394. Ket
  6395. End
  6396. ------------------------------------------------------------------
  6397. /\w*\w/B
  6398. ------------------------------------------------------------------
  6399. Bra
  6400. \w*
  6401. \w
  6402. Ket
  6403. End
  6404. ------------------------------------------------------------------
  6405. /\w*\W/B
  6406. ------------------------------------------------------------------
  6407. Bra
  6408. \w*+
  6409. \W
  6410. Ket
  6411. End
  6412. ------------------------------------------------------------------
  6413. /\W*a/B
  6414. ------------------------------------------------------------------
  6415. Bra
  6416. \W*+
  6417. a
  6418. Ket
  6419. End
  6420. ------------------------------------------------------------------
  6421. /\W*2/B
  6422. ------------------------------------------------------------------
  6423. Bra
  6424. \W*+
  6425. 2
  6426. Ket
  6427. End
  6428. ------------------------------------------------------------------
  6429. /\W*\d/B
  6430. ------------------------------------------------------------------
  6431. Bra
  6432. \W*+
  6433. \d
  6434. Ket
  6435. End
  6436. ------------------------------------------------------------------
  6437. /\W*\D/B
  6438. ------------------------------------------------------------------
  6439. Bra
  6440. \W*
  6441. \D
  6442. Ket
  6443. End
  6444. ------------------------------------------------------------------
  6445. /\W*\s/B
  6446. ------------------------------------------------------------------
  6447. Bra
  6448. \W*
  6449. \s
  6450. Ket
  6451. End
  6452. ------------------------------------------------------------------
  6453. /\W*\S/B
  6454. ------------------------------------------------------------------
  6455. Bra
  6456. \W*
  6457. \S
  6458. Ket
  6459. End
  6460. ------------------------------------------------------------------
  6461. /\W*\w/B
  6462. ------------------------------------------------------------------
  6463. Bra
  6464. \W*+
  6465. \w
  6466. Ket
  6467. End
  6468. ------------------------------------------------------------------
  6469. /\W*\W/B
  6470. ------------------------------------------------------------------
  6471. Bra
  6472. \W*
  6473. \W
  6474. Ket
  6475. End
  6476. ------------------------------------------------------------------
  6477. /[^a]+a/B
  6478. ------------------------------------------------------------------
  6479. Bra
  6480. [^a]++
  6481. a
  6482. Ket
  6483. End
  6484. ------------------------------------------------------------------
  6485. /[^a]+a/Bi
  6486. ------------------------------------------------------------------
  6487. Bra
  6488. /i [^a]++
  6489. /i a
  6490. Ket
  6491. End
  6492. ------------------------------------------------------------------
  6493. /[^a]+A/Bi
  6494. ------------------------------------------------------------------
  6495. Bra
  6496. /i [^a]++
  6497. /i A
  6498. Ket
  6499. End
  6500. ------------------------------------------------------------------
  6501. /[^a]+b/B
  6502. ------------------------------------------------------------------
  6503. Bra
  6504. [^a]+
  6505. b
  6506. Ket
  6507. End
  6508. ------------------------------------------------------------------
  6509. /[^a]+\d/B
  6510. ------------------------------------------------------------------
  6511. Bra
  6512. [^a]+
  6513. \d
  6514. Ket
  6515. End
  6516. ------------------------------------------------------------------
  6517. /a*[^a]/B
  6518. ------------------------------------------------------------------
  6519. Bra
  6520. a*+
  6521. [^a]
  6522. Ket
  6523. End
  6524. ------------------------------------------------------------------
  6525. /(?P<abc>x)(?P<xyz>y)/I
  6526. Capture group count = 2
  6527. Named capture groups:
  6528. abc 1
  6529. xyz 2
  6530. First code unit = 'x'
  6531. Last code unit = 'y'
  6532. Subject length lower bound = 2
  6533. xy\=copy=abc,copy=xyz
  6534. 0: xy
  6535. 1: x
  6536. 2: y
  6537. C x (1) abc (group 1)
  6538. C y (1) xyz (group 2)
  6539. /(?<abc>x)(?'xyz'y)/I
  6540. Capture group count = 2
  6541. Named capture groups:
  6542. abc 1
  6543. xyz 2
  6544. First code unit = 'x'
  6545. Last code unit = 'y'
  6546. Subject length lower bound = 2
  6547. xy\=copy=abc,copy=xyz
  6548. 0: xy
  6549. 1: x
  6550. 2: y
  6551. C x (1) abc (group 1)
  6552. C y (1) xyz (group 2)
  6553. /(?<abc'x)(?'xyz'y)/I
  6554. Failed: error 142 at offset 6: syntax error in subpattern name (missing terminator?)
  6555. /(?<abc>x)(?'xyz>y)/I
  6556. Failed: error 142 at offset 15: syntax error in subpattern name (missing terminator?)
  6557. /(?P'abc'x)(?P<xyz>y)/I
  6558. Failed: error 141 at offset 3: unrecognized character after (?P
  6559. /^(?:(?(ZZ)a|b)(?<ZZ>X))+/
  6560. bXaX
  6561. 0: bXaX
  6562. 1: X
  6563. bXbX
  6564. 0: bX
  6565. 1: X
  6566. \= Expect no match
  6567. aXaX
  6568. No match
  6569. aXbX
  6570. No match
  6571. /^(?P>abc)(?<abcd>xxx)/
  6572. Failed: error 115 at offset 5: reference to non-existent subpattern
  6573. /^(?P>abc)(?<abc>x|y)/
  6574. xx
  6575. 0: xx
  6576. 1: x
  6577. xy
  6578. 0: xy
  6579. 1: y
  6580. yy
  6581. 0: yy
  6582. 1: y
  6583. yx
  6584. 0: yx
  6585. 1: x
  6586. /^(?P>abc)(?P<abc>x|y)/
  6587. xx
  6588. 0: xx
  6589. 1: x
  6590. xy
  6591. 0: xy
  6592. 1: y
  6593. yy
  6594. 0: yy
  6595. 1: y
  6596. yx
  6597. 0: yx
  6598. 1: x
  6599. /^((?(abc)a|b)(?<abc>x|y))+/
  6600. bxay
  6601. 0: bxay
  6602. 1: ay
  6603. 2: y
  6604. bxby
  6605. 0: bx
  6606. 1: bx
  6607. 2: x
  6608. \= Expect no match
  6609. axby
  6610. No match
  6611. /^(((?P=abc)|X)(?<abc>x|y))+/
  6612. XxXxxx
  6613. 0: XxXxxx
  6614. 1: xx
  6615. 2: x
  6616. 3: x
  6617. XxXyyx
  6618. 0: XxXyyx
  6619. 1: yx
  6620. 2: y
  6621. 3: x
  6622. XxXyxx
  6623. 0: XxXy
  6624. 1: Xy
  6625. 2: X
  6626. 3: y
  6627. \= Expect no match
  6628. x
  6629. No match
  6630. /^(?1)(abc)/
  6631. abcabc
  6632. 0: abcabc
  6633. 1: abc
  6634. /^(?:(?:\1|X)(a|b))+/
  6635. Xaaa
  6636. 0: Xaaa
  6637. 1: a
  6638. Xaba
  6639. 0: Xa
  6640. 1: a
  6641. /^[\E\Qa\E-\Qz\E]+/B
  6642. ------------------------------------------------------------------
  6643. Bra
  6644. ^
  6645. [a-z]++
  6646. Ket
  6647. End
  6648. ------------------------------------------------------------------
  6649. /^[a\Q]bc\E]/B
  6650. ------------------------------------------------------------------
  6651. Bra
  6652. ^
  6653. [\]a-c]
  6654. Ket
  6655. End
  6656. ------------------------------------------------------------------
  6657. /^[a-\Q\E]/B
  6658. ------------------------------------------------------------------
  6659. Bra
  6660. ^
  6661. [\-a]
  6662. Ket
  6663. End
  6664. ------------------------------------------------------------------
  6665. /^(?P>abc)[()](?<abc>)/B
  6666. ------------------------------------------------------------------
  6667. Bra
  6668. ^
  6669. Recurse
  6670. [()]
  6671. CBra 1
  6672. Ket
  6673. Ket
  6674. End
  6675. ------------------------------------------------------------------
  6676. /^((?(abc)y)[()](?P<abc>x))+/B
  6677. ------------------------------------------------------------------
  6678. Bra
  6679. ^
  6680. CBra 1
  6681. Cond
  6682. 2 Cond ref
  6683. y
  6684. Ket
  6685. [()]
  6686. CBra 2
  6687. x
  6688. Ket
  6689. KetRmax
  6690. Ket
  6691. End
  6692. ------------------------------------------------------------------
  6693. (xy)x
  6694. 0: (xy)x
  6695. 1: y)x
  6696. 2: x
  6697. /^(?P>abc)\Q()\E(?<abc>)/B
  6698. ------------------------------------------------------------------
  6699. Bra
  6700. ^
  6701. Recurse
  6702. ()
  6703. CBra 1
  6704. Ket
  6705. Ket
  6706. End
  6707. ------------------------------------------------------------------
  6708. /^(?P>abc)[a\Q(]\E(](?<abc>)/B
  6709. ------------------------------------------------------------------
  6710. Bra
  6711. ^
  6712. Recurse
  6713. [(\]a]
  6714. CBra 1
  6715. Ket
  6716. Ket
  6717. End
  6718. ------------------------------------------------------------------
  6719. /^(?P>abc) # this is (a comment)
  6720. (?<abc>)/Bx
  6721. ------------------------------------------------------------------
  6722. Bra
  6723. ^
  6724. Recurse
  6725. CBra 1
  6726. Ket
  6727. Ket
  6728. End
  6729. ------------------------------------------------------------------
  6730. /^\W*(?:(?<one>(?<two>.)\W*(?&one)\W*\k<two>|)|(?<three>(?<four>.)\W*(?&three)\W*\k'four'|\W*.\W*))\W*$/Ii
  6731. Capture group count = 4
  6732. Max back reference = 4
  6733. Named capture groups:
  6734. four 4
  6735. one 1
  6736. three 3
  6737. two 2
  6738. May match empty string
  6739. Compile options: caseless
  6740. Overall options: anchored caseless
  6741. Subject length lower bound = 0
  6742. 1221
  6743. 0: 1221
  6744. 1: 1221
  6745. 2: 1
  6746. Satan, oscillate my metallic sonatas!
  6747. 0: Satan, oscillate my metallic sonatas!
  6748. 1: <unset>
  6749. 2: <unset>
  6750. 3: Satan, oscillate my metallic sonatas
  6751. 4: S
  6752. A man, a plan, a canal: Panama!
  6753. 0: A man, a plan, a canal: Panama!
  6754. 1: <unset>
  6755. 2: <unset>
  6756. 3: A man, a plan, a canal: Panama
  6757. 4: A
  6758. Able was I ere I saw Elba.
  6759. 0: Able was I ere I saw Elba.
  6760. 1: <unset>
  6761. 2: <unset>
  6762. 3: Able was I ere I saw Elba
  6763. 4: A
  6764. \= Expect no match
  6765. The quick brown fox
  6766. No match
  6767. /(?=(\w+))\1:/I
  6768. Capture group count = 1
  6769. Max back reference = 1
  6770. Starting code units: 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P
  6771. Q R S T U V W X Y Z _ a b c d e f g h i j k l m n o p q r s t u v w x y z
  6772. Last code unit = ':'
  6773. Subject length lower bound = 2
  6774. abcd:
  6775. 0: abcd:
  6776. 1: abcd
  6777. /(?=(?'abc'\w+))\k<abc>:/I
  6778. Capture group count = 1
  6779. Max back reference = 1
  6780. Named capture groups:
  6781. abc 1
  6782. Starting code units: 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P
  6783. Q R S T U V W X Y Z _ a b c d e f g h i j k l m n o p q r s t u v w x y z
  6784. Last code unit = ':'
  6785. Subject length lower bound = 2
  6786. abcd:
  6787. 0: abcd:
  6788. 1: abcd
  6789. /(?'abc'a|b)(?<abc>d|e)\k<abc>{2}/dupnames
  6790. adaa
  6791. 0: adaa
  6792. 1: a
  6793. 2: d
  6794. \= Expect no match
  6795. addd
  6796. No match
  6797. adbb
  6798. No match
  6799. /(?'abc'a|b)(?<abc>d|e)(?&abc){2}/dupnames
  6800. bdaa
  6801. 0: bdaa
  6802. 1: b
  6803. 2: d
  6804. bdab
  6805. 0: bdab
  6806. 1: b
  6807. 2: d
  6808. \= Expect no match
  6809. bddd
  6810. No match
  6811. /(?(<bc))/
  6812. Failed: error 142 at offset 6: syntax error in subpattern name (missing terminator?)
  6813. /(?(''))/
  6814. Failed: error 162 at offset 4: subpattern name expected
  6815. /(?('R')stuff)/
  6816. Failed: error 115 at offset 4: reference to non-existent subpattern
  6817. /((abc (?(R) (?(R1)1) (?(R2)2) X | (?1) (?2) (?R) ))) /x
  6818. abcabc1Xabc2XabcXabcabc
  6819. 0: abcabc1Xabc2XabcX
  6820. 1: abcabc1Xabc2XabcX
  6821. 2: abcabc1Xabc2XabcX
  6822. /(?<A> (?'B' abc (?(R) (?(R&A)1) (?(R&B)2) X | (?1) (?2) (?R) ))) /x
  6823. abcabc1Xabc2XabcXabcabc
  6824. 0: abcabc1Xabc2XabcX
  6825. 1: abcabc1Xabc2XabcX
  6826. 2: abcabc1Xabc2XabcX
  6827. /(?<A> (?'B' abc (?(R) (?(R&C)1) (?(R&B)2) X | (?1) (?2) (?R) ))) /x
  6828. Failed: error 115 at offset 27: reference to non-existent subpattern
  6829. /^(?(DEFINE) abc | xyz ) /x
  6830. Failed: error 154 at offset 4: DEFINE subpattern contains more than one branch
  6831. /(?(DEFINE) abc) xyz/Ix
  6832. Capture group count = 0
  6833. Options: extended
  6834. First code unit = 'x'
  6835. Last code unit = 'z'
  6836. Subject length lower bound = 3
  6837. /(a|)*\d/
  6838. aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4\=ovector=0
  6839. 0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4
  6840. 1:
  6841. \= Expect no match
  6842. aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\=ovector=0
  6843. No match
  6844. /^a.b/newline=lf
  6845. a\rb
  6846. 0: a\x0db
  6847. \= Expect no match
  6848. a\nb
  6849. No match
  6850. /^a.b/newline=cr
  6851. a\nb
  6852. 0: a\x0ab
  6853. \= Expect no match
  6854. a\rb
  6855. No match
  6856. /^a.b/newline=anycrlf
  6857. a\x85b
  6858. 0: a\x85b
  6859. \= Expect no match
  6860. a\rb
  6861. No match
  6862. /^a.b/newline=any
  6863. \= Expect no match
  6864. a\nb
  6865. No match
  6866. a\rb
  6867. No match
  6868. a\x85b
  6869. No match
  6870. /^abc./gmx,newline=any
  6871. abc1 \x0aabc2 \x0babc3xx \x0cabc4 \x0dabc5xx \x0d\x0aabc6 \x85abc7 JUNK
  6872. 0: abc1
  6873. 0: abc2
  6874. 0: abc3
  6875. 0: abc4
  6876. 0: abc5
  6877. 0: abc6
  6878. 0: abc7
  6879. /abc.$/gmx,newline=any
  6880. abc1\x0a abc2\x0b abc3\x0c abc4\x0d abc5\x0d\x0a abc6\x85 abc7 abc9
  6881. 0: abc1
  6882. 0: abc2
  6883. 0: abc3
  6884. 0: abc4
  6885. 0: abc5
  6886. 0: abc6
  6887. 0: abc9
  6888. /^a\Rb/bsr=unicode
  6889. a\nb
  6890. 0: a\x0ab
  6891. a\rb
  6892. 0: a\x0db
  6893. a\r\nb
  6894. 0: a\x0d\x0ab
  6895. a\x0bb
  6896. 0: a\x0bb
  6897. a\x0cb
  6898. 0: a\x0cb
  6899. a\x85b
  6900. 0: a\x85b
  6901. \= Expect no match
  6902. a\n\rb
  6903. No match
  6904. /^a\R*b/bsr=unicode
  6905. ab
  6906. 0: ab
  6907. a\nb
  6908. 0: a\x0ab
  6909. a\rb
  6910. 0: a\x0db
  6911. a\r\nb
  6912. 0: a\x0d\x0ab
  6913. a\x0bb
  6914. 0: a\x0bb
  6915. a\x0cb
  6916. 0: a\x0cb
  6917. a\x85b
  6918. 0: a\x85b
  6919. a\n\rb
  6920. 0: a\x0a\x0db
  6921. a\n\r\x85\x0cb
  6922. 0: a\x0a\x0d\x85\x0cb
  6923. /^a\R+b/bsr=unicode
  6924. a\nb
  6925. 0: a\x0ab
  6926. a\rb
  6927. 0: a\x0db
  6928. a\r\nb
  6929. 0: a\x0d\x0ab
  6930. a\x0bb
  6931. 0: a\x0bb
  6932. a\x0cb
  6933. 0: a\x0cb
  6934. a\x85b
  6935. 0: a\x85b
  6936. a\n\rb
  6937. 0: a\x0a\x0db
  6938. a\n\r\x85\x0cb
  6939. 0: a\x0a\x0d\x85\x0cb
  6940. \= Expect no match
  6941. ab
  6942. No match
  6943. /^a\R{1,3}b/bsr=unicode
  6944. a\nb
  6945. 0: a\x0ab
  6946. a\n\rb
  6947. 0: a\x0a\x0db
  6948. a\n\r\x85b
  6949. 0: a\x0a\x0d\x85b
  6950. a\r\n\r\nb
  6951. 0: a\x0d\x0a\x0d\x0ab
  6952. a\r\n\r\n\r\nb
  6953. 0: a\x0d\x0a\x0d\x0a\x0d\x0ab
  6954. a\n\r\n\rb
  6955. 0: a\x0a\x0d\x0a\x0db
  6956. a\n\n\r\nb
  6957. 0: a\x0a\x0a\x0d\x0ab
  6958. \= Expect no match
  6959. a\n\n\n\rb
  6960. No match
  6961. a\r
  6962. No match
  6963. /(?&abc)X(?<abc>P)/I
  6964. Capture group count = 1
  6965. Named capture groups:
  6966. abc 1
  6967. Last code unit = 'P'
  6968. Subject length lower bound = 3
  6969. abcPXP123
  6970. 0: PXP
  6971. 1: P
  6972. /(?1)X(?<abc>P)/I
  6973. Capture group count = 1
  6974. Named capture groups:
  6975. abc 1
  6976. Last code unit = 'P'
  6977. Subject length lower bound = 3
  6978. abcPXP123
  6979. 0: PXP
  6980. 1: P
  6981. /(?:a(?&abc)b)*(?<abc>x)/
  6982. 123axbaxbaxbx456
  6983. 0: axbaxbaxbx
  6984. 1: x
  6985. 123axbaxbaxb456
  6986. 0: x
  6987. 1: x
  6988. /(?:a(?&abc)b){1,5}(?<abc>x)/
  6989. 123axbaxbaxbx456
  6990. 0: axbaxbaxbx
  6991. 1: x
  6992. /(?:a(?&abc)b){2,5}(?<abc>x)/
  6993. 123axbaxbaxbx456
  6994. 0: axbaxbaxbx
  6995. 1: x
  6996. /(?:a(?&abc)b){2,}(?<abc>x)/
  6997. 123axbaxbaxbx456
  6998. 0: axbaxbaxbx
  6999. 1: x
  7000. /(abc)(?i:(?1))/
  7001. defabcabcxyz
  7002. 0: abcabc
  7003. 1: abc
  7004. \= Expect no match
  7005. DEFabcABCXYZ
  7006. No match
  7007. /(abc)(?:(?i)(?1))/
  7008. defabcabcxyz
  7009. 0: abcabc
  7010. 1: abc
  7011. \= Expect no match
  7012. DEFabcABCXYZ
  7013. No match
  7014. /^(a)\g-2/
  7015. Failed: error 115 at offset 8: reference to non-existent subpattern
  7016. /^(a)\g/
  7017. Failed: error 157 at offset 6: \g is not followed by a braced, angle-bracketed, or quoted name/number or by a plain number
  7018. /^(a)\g{0}/
  7019. Failed: error 115 at offset 9: reference to non-existent subpattern
  7020. /^(a)\g{3/
  7021. Failed: error 157 at offset 6: \g is not followed by a braced, angle-bracketed, or quoted name/number or by a plain number
  7022. /^(a)\g{aa}/
  7023. Failed: error 115 at offset 7: reference to non-existent subpattern
  7024. /^a.b/newline=lf
  7025. a\rb
  7026. 0: a\x0db
  7027. \= Expect no match
  7028. a\nb
  7029. No match
  7030. /.+foo/
  7031. afoo
  7032. 0: afoo
  7033. \= Expect no match
  7034. \r\nfoo
  7035. No match
  7036. \nfoo
  7037. No match
  7038. /.+foo/newline=crlf
  7039. afoo
  7040. 0: afoo
  7041. \nfoo
  7042. 0: \x0afoo
  7043. \= Expect no match
  7044. \r\nfoo
  7045. No match
  7046. /.+foo/newline=any
  7047. afoo
  7048. 0: afoo
  7049. \= Expect no match
  7050. \nfoo
  7051. No match
  7052. \r\nfoo
  7053. No match
  7054. /.+foo/s
  7055. afoo
  7056. 0: afoo
  7057. \r\nfoo
  7058. 0: \x0d\x0afoo
  7059. \nfoo
  7060. 0: \x0afoo
  7061. /^$/gm,newline=any
  7062. abc\r\rxyz
  7063. 0:
  7064. abc\n\rxyz
  7065. 0:
  7066. \= Expect no match
  7067. abc\r\nxyz
  7068. No match
  7069. /(?m)^$/g,newline=any,aftertext
  7070. abc\r\n\r\n
  7071. 0:
  7072. 0+ \x0d\x0a
  7073. /(?m)^$|^\r\n/g,newline=any,aftertext
  7074. abc\r\n\r\n
  7075. 0:
  7076. 0+ \x0d\x0a
  7077. 0: \x0d\x0a
  7078. 0+
  7079. /(?m)$/g,newline=any,aftertext
  7080. abc\r\n\r\n
  7081. 0:
  7082. 0+ \x0d\x0a\x0d\x0a
  7083. 0:
  7084. 0+ \x0d\x0a
  7085. 0:
  7086. 0+
  7087. /abc.$/gmx,newline=anycrlf
  7088. abc1\x0a abc2\x0b abc3\x0c abc4\x0d abc5\x0d\x0a abc6\x85 abc9
  7089. 0: abc1
  7090. 0: abc4
  7091. 0: abc5
  7092. 0: abc9
  7093. /^X/m
  7094. XABC
  7095. 0: X
  7096. \= Expect no match
  7097. XABC\=notbol
  7098. No match
  7099. /(ab|c)(?-1)/B
  7100. ------------------------------------------------------------------
  7101. Bra
  7102. CBra 1
  7103. ab
  7104. Alt
  7105. c
  7106. Ket
  7107. Recurse
  7108. Ket
  7109. End
  7110. ------------------------------------------------------------------
  7111. abc
  7112. 0: abc
  7113. 1: ab
  7114. /xy(?+1)(abc)/B
  7115. ------------------------------------------------------------------
  7116. Bra
  7117. xy
  7118. Recurse
  7119. CBra 1
  7120. abc
  7121. Ket
  7122. Ket
  7123. End
  7124. ------------------------------------------------------------------
  7125. xyabcabc
  7126. 0: xyabcabc
  7127. 1: abc
  7128. \= Expect no match
  7129. xyabc
  7130. No match
  7131. /x(?-0)y/
  7132. Failed: error 126 at offset 5: a relative value of zero is not allowed
  7133. /x(?-1)y/
  7134. Failed: error 115 at offset 5: reference to non-existent subpattern
  7135. /x(?+0)y/
  7136. Failed: error 126 at offset 5: a relative value of zero is not allowed
  7137. /x(?+1)y/
  7138. Failed: error 115 at offset 5: reference to non-existent subpattern
  7139. /^(abc)?(?(-1)X|Y)/B
  7140. ------------------------------------------------------------------
  7141. Bra
  7142. ^
  7143. Brazero
  7144. CBra 1
  7145. abc
  7146. Ket
  7147. Cond
  7148. 1 Cond ref
  7149. X
  7150. Alt
  7151. Y
  7152. Ket
  7153. Ket
  7154. End
  7155. ------------------------------------------------------------------
  7156. abcX
  7157. 0: abcX
  7158. 1: abc
  7159. Y
  7160. 0: Y
  7161. \= Expect no match
  7162. abcY
  7163. No match
  7164. /^((?(+1)X|Y)(abc))+/B
  7165. ------------------------------------------------------------------
  7166. Bra
  7167. ^
  7168. CBra 1
  7169. Cond
  7170. 2 Cond ref
  7171. X
  7172. Alt
  7173. Y
  7174. Ket
  7175. CBra 2
  7176. abc
  7177. Ket
  7178. KetRmax
  7179. Ket
  7180. End
  7181. ------------------------------------------------------------------
  7182. YabcXabc
  7183. 0: YabcXabc
  7184. 1: Xabc
  7185. 2: abc
  7186. YabcXabcXabc
  7187. 0: YabcXabcXabc
  7188. 1: Xabc
  7189. 2: abc
  7190. \= Expect no match
  7191. XabcXabc
  7192. No match
  7193. /(?(-1)a)/B
  7194. Failed: error 115 at offset 5: reference to non-existent subpattern
  7195. /((?(-1)a))/B
  7196. ------------------------------------------------------------------
  7197. Bra
  7198. CBra 1
  7199. Cond
  7200. 1 Cond ref
  7201. a
  7202. Ket
  7203. Ket
  7204. Ket
  7205. End
  7206. ------------------------------------------------------------------
  7207. /((?(-2)a))/B
  7208. Failed: error 115 at offset 6: reference to non-existent subpattern
  7209. /^(?(+1)X|Y)(.)/B
  7210. ------------------------------------------------------------------
  7211. Bra
  7212. ^
  7213. Cond
  7214. 1 Cond ref
  7215. X
  7216. Alt
  7217. Y
  7218. Ket
  7219. CBra 1
  7220. Any
  7221. Ket
  7222. Ket
  7223. End
  7224. ------------------------------------------------------------------
  7225. Y!
  7226. 0: Y!
  7227. 1: !
  7228. /(?<A>tom|bon)-\k{A}/
  7229. tom-tom
  7230. 0: tom-tom
  7231. 1: tom
  7232. bon-bon
  7233. 0: bon-bon
  7234. 1: bon
  7235. \= Expect no match
  7236. tom-bon
  7237. No match
  7238. /\g{A/
  7239. Failed: error 142 at offset 4: syntax error in subpattern name (missing terminator?)
  7240. /(?|(abc)|(xyz))/B
  7241. ------------------------------------------------------------------
  7242. Bra
  7243. Bra
  7244. CBra 1
  7245. abc
  7246. Ket
  7247. Alt
  7248. CBra 1
  7249. xyz
  7250. Ket
  7251. Ket
  7252. Ket
  7253. End
  7254. ------------------------------------------------------------------
  7255. >abc<
  7256. 0: abc
  7257. 1: abc
  7258. >xyz<
  7259. 0: xyz
  7260. 1: xyz
  7261. /(x)(?|(abc)|(xyz))(x)/B
  7262. ------------------------------------------------------------------
  7263. Bra
  7264. CBra 1
  7265. x
  7266. Ket
  7267. Bra
  7268. CBra 2
  7269. abc
  7270. Ket
  7271. Alt
  7272. CBra 2
  7273. xyz
  7274. Ket
  7275. Ket
  7276. CBra 3
  7277. x
  7278. Ket
  7279. Ket
  7280. End
  7281. ------------------------------------------------------------------
  7282. xabcx
  7283. 0: xabcx
  7284. 1: x
  7285. 2: abc
  7286. 3: x
  7287. xxyzx
  7288. 0: xxyzx
  7289. 1: x
  7290. 2: xyz
  7291. 3: x
  7292. /(x)(?|(abc)(pqr)|(xyz))(x)/B
  7293. ------------------------------------------------------------------
  7294. Bra
  7295. CBra 1
  7296. x
  7297. Ket
  7298. Bra
  7299. CBra 2
  7300. abc
  7301. Ket
  7302. CBra 3
  7303. pqr
  7304. Ket
  7305. Alt
  7306. CBra 2
  7307. xyz
  7308. Ket
  7309. Ket
  7310. CBra 4
  7311. x
  7312. Ket
  7313. Ket
  7314. End
  7315. ------------------------------------------------------------------
  7316. xabcpqrx
  7317. 0: xabcpqrx
  7318. 1: x
  7319. 2: abc
  7320. 3: pqr
  7321. 4: x
  7322. xxyzx
  7323. 0: xxyzx
  7324. 1: x
  7325. 2: xyz
  7326. 3: <unset>
  7327. 4: x
  7328. /\H++X/B
  7329. ------------------------------------------------------------------
  7330. Bra
  7331. \H++
  7332. X
  7333. Ket
  7334. End
  7335. ------------------------------------------------------------------
  7336. \= Expect no match
  7337. XXXX
  7338. No match
  7339. /\H+\hY/B
  7340. ------------------------------------------------------------------
  7341. Bra
  7342. \H++
  7343. \h
  7344. Y
  7345. Ket
  7346. End
  7347. ------------------------------------------------------------------
  7348. XXXX Y
  7349. 0: XXXX Y
  7350. /\H+ Y/B
  7351. ------------------------------------------------------------------
  7352. Bra
  7353. \H++
  7354. Y
  7355. Ket
  7356. End
  7357. ------------------------------------------------------------------
  7358. /\h+A/B
  7359. ------------------------------------------------------------------
  7360. Bra
  7361. \h++
  7362. A
  7363. Ket
  7364. End
  7365. ------------------------------------------------------------------
  7366. /\v*B/B
  7367. ------------------------------------------------------------------
  7368. Bra
  7369. \v*+
  7370. B
  7371. Ket
  7372. End
  7373. ------------------------------------------------------------------
  7374. /\V+\x0a/B
  7375. ------------------------------------------------------------------
  7376. Bra
  7377. \V++
  7378. \x0a
  7379. Ket
  7380. End
  7381. ------------------------------------------------------------------
  7382. /A+\h/B
  7383. ------------------------------------------------------------------
  7384. Bra
  7385. A++
  7386. \h
  7387. Ket
  7388. End
  7389. ------------------------------------------------------------------
  7390. / *\H/B
  7391. ------------------------------------------------------------------
  7392. Bra
  7393. *+
  7394. \H
  7395. Ket
  7396. End
  7397. ------------------------------------------------------------------
  7398. /A*\v/B
  7399. ------------------------------------------------------------------
  7400. Bra
  7401. A*+
  7402. \v
  7403. Ket
  7404. End
  7405. ------------------------------------------------------------------
  7406. /\x0b*\V/B
  7407. ------------------------------------------------------------------
  7408. Bra
  7409. \x0b*+
  7410. \V
  7411. Ket
  7412. End
  7413. ------------------------------------------------------------------
  7414. /\d+\h/B
  7415. ------------------------------------------------------------------
  7416. Bra
  7417. \d++
  7418. \h
  7419. Ket
  7420. End
  7421. ------------------------------------------------------------------
  7422. /\d*\v/B
  7423. ------------------------------------------------------------------
  7424. Bra
  7425. \d*+
  7426. \v
  7427. Ket
  7428. End
  7429. ------------------------------------------------------------------
  7430. /S+\h\S+\v/B
  7431. ------------------------------------------------------------------
  7432. Bra
  7433. S++
  7434. \h
  7435. \S++
  7436. \v
  7437. Ket
  7438. End
  7439. ------------------------------------------------------------------
  7440. /\w{3,}\h\w+\v/B
  7441. ------------------------------------------------------------------
  7442. Bra
  7443. \w{3}
  7444. \w*+
  7445. \h
  7446. \w++
  7447. \v
  7448. Ket
  7449. End
  7450. ------------------------------------------------------------------
  7451. /\h+\d\h+\w\h+\S\h+\H/B
  7452. ------------------------------------------------------------------
  7453. Bra
  7454. \h++
  7455. \d
  7456. \h++
  7457. \w
  7458. \h++
  7459. \S
  7460. \h++
  7461. \H
  7462. Ket
  7463. End
  7464. ------------------------------------------------------------------
  7465. /\v+\d\v+\w\v+\S\v+\V/B
  7466. ------------------------------------------------------------------
  7467. Bra
  7468. \v++
  7469. \d
  7470. \v++
  7471. \w
  7472. \v++
  7473. \S
  7474. \v++
  7475. \V
  7476. Ket
  7477. End
  7478. ------------------------------------------------------------------
  7479. /\H+\h\H+\d/B
  7480. ------------------------------------------------------------------
  7481. Bra
  7482. \H++
  7483. \h
  7484. \H+
  7485. \d
  7486. Ket
  7487. End
  7488. ------------------------------------------------------------------
  7489. /\V+\v\V+\w/B
  7490. ------------------------------------------------------------------
  7491. Bra
  7492. \V++
  7493. \v
  7494. \V+
  7495. \w
  7496. Ket
  7497. End
  7498. ------------------------------------------------------------------
  7499. /\( (?: [^()]* | (?R) )* \)/x
  7500. (0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(00)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)\=jitstack=1024
  7501. 0: (0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(00)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)
  7502. /[\E]AAA/
  7503. Failed: error 106 at offset 7: missing terminating ] for character class
  7504. /[\Q\E]AAA/
  7505. Failed: error 106 at offset 9: missing terminating ] for character class
  7506. /[^\E]AAA/
  7507. Failed: error 106 at offset 8: missing terminating ] for character class
  7508. /[^\Q\E]AAA/
  7509. Failed: error 106 at offset 10: missing terminating ] for character class
  7510. /[\E^]AAA/
  7511. Failed: error 106 at offset 8: missing terminating ] for character class
  7512. /[\Q\E^]AAA/
  7513. Failed: error 106 at offset 10: missing terminating ] for character class
  7514. /A(*PRUNE)B(*SKIP)C(*THEN)D(*COMMIT)E(*F)F(*FAIL)G(?!)H(*ACCEPT)I/B
  7515. ------------------------------------------------------------------
  7516. Bra
  7517. A
  7518. *PRUNE
  7519. B
  7520. *SKIP
  7521. C
  7522. *THEN
  7523. D
  7524. *COMMIT
  7525. E
  7526. *FAIL
  7527. F
  7528. *FAIL
  7529. G
  7530. *FAIL
  7531. H
  7532. *ACCEPT
  7533. I
  7534. Ket
  7535. End
  7536. ------------------------------------------------------------------
  7537. /^a+(*FAIL)/auto_callout
  7538. \= Expect no match
  7539. aaaaaa
  7540. --->aaaaaa
  7541. +0 ^ ^
  7542. +1 ^ a+
  7543. +3 ^ ^ (*FAIL)
  7544. +3 ^ ^ (*FAIL)
  7545. +3 ^ ^ (*FAIL)
  7546. +3 ^ ^ (*FAIL)
  7547. +3 ^ ^ (*FAIL)
  7548. +3 ^^ (*FAIL)
  7549. No match
  7550. /a+b?c+(*FAIL)/auto_callout
  7551. \= Expect no match
  7552. aaabccc
  7553. --->aaabccc
  7554. +0 ^ a+
  7555. +2 ^ ^ b?
  7556. +4 ^ ^ c+
  7557. +6 ^ ^ (*FAIL)
  7558. +6 ^ ^ (*FAIL)
  7559. +6 ^ ^ (*FAIL)
  7560. +0 ^ a+
  7561. +2 ^ ^ b?
  7562. +4 ^ ^ c+
  7563. +6 ^ ^ (*FAIL)
  7564. +6 ^ ^ (*FAIL)
  7565. +6 ^ ^ (*FAIL)
  7566. +0 ^ a+
  7567. +2 ^^ b?
  7568. +4 ^ ^ c+
  7569. +6 ^ ^ (*FAIL)
  7570. +6 ^ ^ (*FAIL)
  7571. +6 ^ ^ (*FAIL)
  7572. No match
  7573. /a+b?(*PRUNE)c+(*FAIL)/auto_callout
  7574. \= Expect no match
  7575. aaabccc
  7576. --->aaabccc
  7577. +0 ^ a+
  7578. +2 ^ ^ b?
  7579. +4 ^ ^ (*PRUNE)
  7580. +12 ^ ^ c+
  7581. +14 ^ ^ (*FAIL)
  7582. +14 ^ ^ (*FAIL)
  7583. +14 ^ ^ (*FAIL)
  7584. +0 ^ a+
  7585. +2 ^ ^ b?
  7586. +4 ^ ^ (*PRUNE)
  7587. +12 ^ ^ c+
  7588. +14 ^ ^ (*FAIL)
  7589. +14 ^ ^ (*FAIL)
  7590. +14 ^ ^ (*FAIL)
  7591. +0 ^ a+
  7592. +2 ^^ b?
  7593. +4 ^ ^ (*PRUNE)
  7594. +12 ^ ^ c+
  7595. +14 ^ ^ (*FAIL)
  7596. +14 ^ ^ (*FAIL)
  7597. +14 ^ ^ (*FAIL)
  7598. No match
  7599. /a+b?(*COMMIT)c+(*FAIL)/auto_callout
  7600. \= Expect no match
  7601. aaabccc
  7602. --->aaabccc
  7603. +0 ^ a+
  7604. +2 ^ ^ b?
  7605. +4 ^ ^ (*COMMIT)
  7606. +13 ^ ^ c+
  7607. +15 ^ ^ (*FAIL)
  7608. +15 ^ ^ (*FAIL)
  7609. +15 ^ ^ (*FAIL)
  7610. No match
  7611. /a+b?(*SKIP)c+(*FAIL)/auto_callout
  7612. \= Expect no match
  7613. aaabcccaaabccc
  7614. --->aaabcccaaabccc
  7615. +0 ^ a+
  7616. +2 ^ ^ b?
  7617. +4 ^ ^ (*SKIP)
  7618. +11 ^ ^ c+
  7619. +13 ^ ^ (*FAIL)
  7620. +13 ^ ^ (*FAIL)
  7621. +13 ^ ^ (*FAIL)
  7622. +0 ^ a+
  7623. +2 ^ ^ b?
  7624. +4 ^ ^ (*SKIP)
  7625. +11 ^ ^ c+
  7626. +13 ^ ^ (*FAIL)
  7627. +13 ^ ^ (*FAIL)
  7628. +13 ^ ^ (*FAIL)
  7629. No match
  7630. /a+b?(*THEN)c+(*FAIL)/auto_callout
  7631. \= Expect no match
  7632. aaabccc
  7633. --->aaabccc
  7634. +0 ^ a+
  7635. +2 ^ ^ b?
  7636. +4 ^ ^ (*THEN)
  7637. +11 ^ ^ c+
  7638. +13 ^ ^ (*FAIL)
  7639. +13 ^ ^ (*FAIL)
  7640. +13 ^ ^ (*FAIL)
  7641. +0 ^ a+
  7642. +2 ^ ^ b?
  7643. +4 ^ ^ (*THEN)
  7644. +11 ^ ^ c+
  7645. +13 ^ ^ (*FAIL)
  7646. +13 ^ ^ (*FAIL)
  7647. +13 ^ ^ (*FAIL)
  7648. +0 ^ a+
  7649. +2 ^^ b?
  7650. +4 ^ ^ (*THEN)
  7651. +11 ^ ^ c+
  7652. +13 ^ ^ (*FAIL)
  7653. +13 ^ ^ (*FAIL)
  7654. +13 ^ ^ (*FAIL)
  7655. No match
  7656. /a(*MARK)b/
  7657. Failed: error 166 at offset 7: (*MARK) must have an argument
  7658. /\g6666666666/
  7659. Failed: error 161 at offset 7: subpattern number is too big
  7660. /[\g6666666666]/B
  7661. ------------------------------------------------------------------
  7662. Bra
  7663. [6g]
  7664. Ket
  7665. End
  7666. ------------------------------------------------------------------
  7667. /(?1)\c[/
  7668. Failed: error 115 at offset 3: reference to non-existent subpattern
  7669. /.+A/newline=crlf
  7670. \= Expect no match
  7671. \r\nA
  7672. No match
  7673. /\nA/newline=crlf
  7674. \r\nA
  7675. 0: \x0aA
  7676. /[\r\n]A/newline=crlf
  7677. \r\nA
  7678. 0: \x0aA
  7679. /(\r|\n)A/newline=crlf
  7680. \r\nA
  7681. 0: \x0aA
  7682. 1: \x0a
  7683. /a(*CR)b/
  7684. Failed: error 160 at offset 5: (*VERB) not recognized or malformed
  7685. /(*CR)a.b/
  7686. a\nb
  7687. 0: a\x0ab
  7688. \= Expect no match
  7689. a\rb
  7690. No match
  7691. /(*CR)a.b/newline=lf
  7692. a\nb
  7693. 0: a\x0ab
  7694. \= Expect no match
  7695. a\rb
  7696. No match
  7697. /(*LF)a.b/newline=CRLF
  7698. a\rb
  7699. 0: a\x0db
  7700. \= Expect no match
  7701. a\nb
  7702. No match
  7703. /(*CRLF)a.b/
  7704. a\rb
  7705. 0: a\x0db
  7706. a\nb
  7707. 0: a\x0ab
  7708. \= Expect no match
  7709. a\r\nb
  7710. No match
  7711. /(*ANYCRLF)a.b/newline=CR
  7712. \= Expect no match
  7713. a\rb
  7714. No match
  7715. a\nb
  7716. No match
  7717. a\r\nb
  7718. No match
  7719. /(*ANY)a.b/newline=cr
  7720. \= Expect no match
  7721. a\rb
  7722. No match
  7723. a\nb
  7724. No match
  7725. a\r\nb
  7726. No match
  7727. a\x85b
  7728. No match
  7729. /(*ANY).*/g
  7730. abc\r\ndef
  7731. 0: abc
  7732. 0:
  7733. 0: def
  7734. 0:
  7735. /(*ANYCRLF).*/g
  7736. abc\r\ndef
  7737. 0: abc
  7738. 0:
  7739. 0: def
  7740. 0:
  7741. /(*CRLF).*/g
  7742. abc\r\ndef
  7743. 0: abc
  7744. 0:
  7745. 0: def
  7746. 0:
  7747. /(*NUL)^.*/
  7748. a\nb\x00ccc
  7749. 0: a\x0ab
  7750. /(*NUL)^.*/s
  7751. a\nb\x00ccc
  7752. 0: a\x0ab\x00ccc
  7753. /^x/m,newline=NUL
  7754. ab\x00xy
  7755. 0: x
  7756. /'#comment' 0d 0a 00 '^x\' 0a 'y'/x,newline=nul,hex
  7757. x\nyz
  7758. 0: x\x0ay
  7759. /(*NUL)^X\NY/
  7760. X\nY
  7761. 0: X\x0aY
  7762. X\rY
  7763. 0: X\x0dY
  7764. \= Expect no match
  7765. X\x00Y
  7766. No match
  7767. /a\Rb/I,bsr=anycrlf
  7768. Capture group count = 0
  7769. \R matches CR, LF, or CRLF
  7770. First code unit = 'a'
  7771. Last code unit = 'b'
  7772. Subject length lower bound = 3
  7773. a\rb
  7774. 0: a\x0db
  7775. a\nb
  7776. 0: a\x0ab
  7777. a\r\nb
  7778. 0: a\x0d\x0ab
  7779. \= Expect no match
  7780. a\x85b
  7781. No match
  7782. a\x0bb
  7783. No match
  7784. /a\Rb/I,bsr=unicode
  7785. Capture group count = 0
  7786. \R matches any Unicode newline
  7787. First code unit = 'a'
  7788. Last code unit = 'b'
  7789. Subject length lower bound = 3
  7790. a\rb
  7791. 0: a\x0db
  7792. a\nb
  7793. 0: a\x0ab
  7794. a\r\nb
  7795. 0: a\x0d\x0ab
  7796. a\x85b
  7797. 0: a\x85b
  7798. a\x0bb
  7799. 0: a\x0bb
  7800. /a\R?b/I,bsr=anycrlf
  7801. Capture group count = 0
  7802. \R matches CR, LF, or CRLF
  7803. First code unit = 'a'
  7804. Last code unit = 'b'
  7805. Subject length lower bound = 2
  7806. a\rb
  7807. 0: a\x0db
  7808. a\nb
  7809. 0: a\x0ab
  7810. a\r\nb
  7811. 0: a\x0d\x0ab
  7812. \= Expect no match
  7813. a\x85b
  7814. No match
  7815. a\x0bb
  7816. No match
  7817. /a\R?b/I,bsr=unicode
  7818. Capture group count = 0
  7819. \R matches any Unicode newline
  7820. First code unit = 'a'
  7821. Last code unit = 'b'
  7822. Subject length lower bound = 2
  7823. a\rb
  7824. 0: a\x0db
  7825. a\nb
  7826. 0: a\x0ab
  7827. a\r\nb
  7828. 0: a\x0d\x0ab
  7829. a\x85b
  7830. 0: a\x85b
  7831. a\x0bb
  7832. 0: a\x0bb
  7833. /a\R{2,4}b/I,bsr=anycrlf
  7834. Capture group count = 0
  7835. \R matches CR, LF, or CRLF
  7836. First code unit = 'a'
  7837. Last code unit = 'b'
  7838. Subject length lower bound = 4
  7839. a\r\n\nb
  7840. 0: a\x0d\x0a\x0ab
  7841. a\n\r\rb
  7842. 0: a\x0a\x0d\x0db
  7843. a\r\n\r\n\r\n\r\nb
  7844. 0: a\x0d\x0a\x0d\x0a\x0d\x0a\x0d\x0ab
  7845. \= Expect no match
  7846. a\x85\x85b
  7847. No match
  7848. a\x0b\x0bb
  7849. No match
  7850. /a\R{2,4}b/I,bsr=unicode
  7851. Capture group count = 0
  7852. \R matches any Unicode newline
  7853. First code unit = 'a'
  7854. Last code unit = 'b'
  7855. Subject length lower bound = 4
  7856. a\r\rb
  7857. 0: a\x0d\x0db
  7858. a\n\n\nb
  7859. 0: a\x0a\x0a\x0ab
  7860. a\r\n\n\r\rb
  7861. 0: a\x0d\x0a\x0a\x0d\x0db
  7862. a\x85\x85b
  7863. 0: a\x85\x85b
  7864. a\x0b\x0bb
  7865. 0: a\x0b\x0bb
  7866. \= Expect no match
  7867. a\r\r\r\r\rb
  7868. No match
  7869. /(*BSR_ANYCRLF)a\Rb/I
  7870. Capture group count = 0
  7871. \R matches CR, LF, or CRLF
  7872. First code unit = 'a'
  7873. Last code unit = 'b'
  7874. Subject length lower bound = 3
  7875. a\nb
  7876. 0: a\x0ab
  7877. a\rb
  7878. 0: a\x0db
  7879. /(*BSR_UNICODE)a\Rb/I
  7880. Capture group count = 0
  7881. \R matches any Unicode newline
  7882. First code unit = 'a'
  7883. Last code unit = 'b'
  7884. Subject length lower bound = 3
  7885. a\x85b
  7886. 0: a\x85b
  7887. /(*BSR_ANYCRLF)(*CRLF)a\Rb/I
  7888. Capture group count = 0
  7889. \R matches CR, LF, or CRLF
  7890. Forced newline is CRLF
  7891. First code unit = 'a'
  7892. Last code unit = 'b'
  7893. Subject length lower bound = 3
  7894. a\nb
  7895. 0: a\x0ab
  7896. a\rb
  7897. 0: a\x0db
  7898. /(*CRLF)(*BSR_UNICODE)a\Rb/I
  7899. Capture group count = 0
  7900. \R matches any Unicode newline
  7901. Forced newline is CRLF
  7902. First code unit = 'a'
  7903. Last code unit = 'b'
  7904. Subject length lower bound = 3
  7905. a\x85b
  7906. 0: a\x85b
  7907. /(*CRLF)(*BSR_ANYCRLF)(*CR)ab/I
  7908. Capture group count = 0
  7909. \R matches CR, LF, or CRLF
  7910. Forced newline is CR
  7911. First code unit = 'a'
  7912. Last code unit = 'b'
  7913. Subject length lower bound = 2
  7914. /(?<a>)(?&)/
  7915. Failed: error 162 at offset 9: subpattern name expected
  7916. /(?<abc>)(?&a)/
  7917. Failed: error 115 at offset 11: reference to non-existent subpattern
  7918. /(?<a>)(?&aaaaaaaaaaaaaaaaaaaaaaa)/
  7919. Failed: error 115 at offset 9: reference to non-existent subpattern
  7920. /(?+-a)/
  7921. Failed: error 129 at offset 2: digit expected after (?+ or (?-
  7922. /(?-+a)/
  7923. Failed: error 111 at offset 3: unrecognized character after (? or (?-
  7924. /(?(-1))/
  7925. Failed: error 115 at offset 5: reference to non-existent subpattern
  7926. /(?(+10))/
  7927. Failed: error 115 at offset 4: reference to non-existent subpattern
  7928. /(?(10))/
  7929. Failed: error 115 at offset 3: reference to non-existent subpattern
  7930. /(?(+2))()()/
  7931. /(?(2))()()/
  7932. /\k''/
  7933. Failed: error 162 at offset 3: subpattern name expected
  7934. /\k<>/
  7935. Failed: error 162 at offset 3: subpattern name expected
  7936. /\k{}/
  7937. Failed: error 162 at offset 3: subpattern name expected
  7938. /\k/
  7939. Failed: error 169 at offset 2: \k is not followed by a braced, angle-bracketed, or quoted name
  7940. /\kabc/
  7941. Failed: error 169 at offset 2: \k is not followed by a braced, angle-bracketed, or quoted name
  7942. /(?P=)/
  7943. Failed: error 162 at offset 4: subpattern name expected
  7944. /(?P>)/
  7945. Failed: error 162 at offset 4: subpattern name expected
  7946. /[[:foo:]]/
  7947. Failed: error 130 at offset 3: unknown POSIX class name
  7948. /[[:1234:]]/
  7949. Failed: error 130 at offset 3: unknown POSIX class name
  7950. /[[:f\oo:]]/
  7951. Failed: error 130 at offset 3: unknown POSIX class name
  7952. /[[: :]]/
  7953. Failed: error 130 at offset 3: unknown POSIX class name
  7954. /[[:...:]]/
  7955. Failed: error 130 at offset 3: unknown POSIX class name
  7956. /[[:l\ower:]]/
  7957. Failed: error 130 at offset 3: unknown POSIX class name
  7958. /[[:abc\:]]/
  7959. Failed: error 130 at offset 3: unknown POSIX class name
  7960. /[abc[:x\]pqr:]]/
  7961. Failed: error 130 at offset 6: unknown POSIX class name
  7962. /[[:a\dz:]]/
  7963. Failed: error 130 at offset 3: unknown POSIX class name
  7964. /(^(a|b\g<-1'c))/
  7965. Failed: error 157 at offset 8: \g is not followed by a braced, angle-bracketed, or quoted name/number or by a plain number
  7966. /^(?+1)(?<a>x|y){0}z/
  7967. xzxx
  7968. 0: xz
  7969. yzyy
  7970. 0: yz
  7971. \= Expect no match
  7972. xxz
  7973. No match
  7974. /(\3)(\1)(a)/
  7975. \= Expect no match
  7976. cat
  7977. No match
  7978. /(\3)(\1)(a)/allow_empty_class,match_unset_backref,dupnames
  7979. cat
  7980. 0: a
  7981. 1:
  7982. 2:
  7983. 3: a
  7984. /TA]/
  7985. The ACTA] comes
  7986. 0: TA]
  7987. /TA]/allow_empty_class,match_unset_backref,dupnames
  7988. The ACTA] comes
  7989. 0: TA]
  7990. /(?2)[]a()b](abc)/
  7991. Failed: error 115 at offset 3: reference to non-existent subpattern
  7992. abcbabc
  7993. /(?2)[^]a()b](abc)/
  7994. Failed: error 115 at offset 3: reference to non-existent subpattern
  7995. abcbabc
  7996. /(?1)[]a()b](abc)/
  7997. abcbabc
  7998. 0: abcbabc
  7999. 1: abc
  8000. \= Expect no match
  8001. abcXabc
  8002. No match
  8003. /(?1)[^]a()b](abc)/
  8004. abcXabc
  8005. 0: abcXabc
  8006. 1: abc
  8007. \= Expect no match
  8008. abcbabc
  8009. No match
  8010. /(?2)[]a()b](abc)(xyz)/
  8011. xyzbabcxyz
  8012. 0: xyzbabcxyz
  8013. 1: abc
  8014. 2: xyz
  8015. /(?&N)[]a(?<N>)](?<M>abc)/
  8016. Failed: error 115 at offset 3: reference to non-existent subpattern
  8017. abc<abc
  8018. /(?&N)[]a(?<N>)](abc)/
  8019. Failed: error 115 at offset 3: reference to non-existent subpattern
  8020. abc<abc
  8021. /a[]b/
  8022. Failed: error 106 at offset 4: missing terminating ] for character class
  8023. /a[^]b/
  8024. Failed: error 106 at offset 5: missing terminating ] for character class
  8025. /a[]b/allow_empty_class,match_unset_backref,dupnames
  8026. \= Expect no match
  8027. ab
  8028. No match
  8029. /a[]+b/allow_empty_class,match_unset_backref,dupnames
  8030. \= Expect no match
  8031. ab
  8032. No match
  8033. /a[]*+b/allow_empty_class,match_unset_backref,dupnames
  8034. \= Expect no match
  8035. ab
  8036. No match
  8037. /a[^]b/allow_empty_class,match_unset_backref,dupnames
  8038. aXb
  8039. 0: aXb
  8040. a\nb
  8041. 0: a\x0ab
  8042. \= Expect no match
  8043. ab
  8044. No match
  8045. /a[^]+b/allow_empty_class,match_unset_backref,dupnames
  8046. aXb
  8047. 0: aXb
  8048. a\nX\nXb
  8049. 0: a\x0aX\x0aXb
  8050. \= Expect no match
  8051. ab
  8052. No match
  8053. /a(?!)b/B
  8054. ------------------------------------------------------------------
  8055. Bra
  8056. a
  8057. *FAIL
  8058. b
  8059. Ket
  8060. End
  8061. ------------------------------------------------------------------
  8062. /(?!)?a/B
  8063. ------------------------------------------------------------------
  8064. Bra
  8065. Brazero
  8066. Assert not
  8067. Ket
  8068. a
  8069. Ket
  8070. End
  8071. ------------------------------------------------------------------
  8072. ab
  8073. 0: a
  8074. /a(*FAIL)+b/
  8075. Failed: error 109 at offset 8: quantifier does not follow a repeatable item
  8076. /(abc|pqr|123){0}[xyz]/I
  8077. Capture group count = 1
  8078. Starting code units: x y z
  8079. Subject length lower bound = 1
  8080. /(?(?=.*b)b|^)/I,auto_callout
  8081. Capture group count = 0
  8082. May match empty string
  8083. Options: auto_callout
  8084. Subject length lower bound = 0
  8085. adc
  8086. --->adc
  8087. +0 ^ (?
  8088. +2 ^ (?=
  8089. +5 ^ .*
  8090. +7 ^ ^ b
  8091. +7 ^ ^ b
  8092. +7 ^^ b
  8093. +7 ^ b
  8094. +11 ^ ^
  8095. +12 ^ )
  8096. +13 ^ End of pattern
  8097. 0:
  8098. abc
  8099. --->abc
  8100. +0 ^ (?
  8101. +2 ^ (?=
  8102. +5 ^ .*
  8103. +7 ^ ^ b
  8104. +7 ^ ^ b
  8105. +7 ^^ b
  8106. +8 ^ ^ )
  8107. +9 ^ b
  8108. +0 ^ (?
  8109. +2 ^ (?=
  8110. +5 ^ .*
  8111. +7 ^ ^ b
  8112. +7 ^^ b
  8113. +7 ^ b
  8114. +8 ^^ )
  8115. +9 ^ b
  8116. +10 ^^ |
  8117. +13 ^^ End of pattern
  8118. 0: b
  8119. /(?(?=b).*b|^d)/I
  8120. Capture group count = 0
  8121. Subject length lower bound = 1
  8122. /(?(?=.*b).*b|^d)/I
  8123. Capture group count = 0
  8124. Subject length lower bound = 1
  8125. /xyz/auto_callout
  8126. xyz
  8127. --->xyz
  8128. +0 ^ x
  8129. +1 ^^ y
  8130. +2 ^ ^ z
  8131. +3 ^ ^ End of pattern
  8132. 0: xyz
  8133. abcxyz
  8134. --->abcxyz
  8135. +0 ^ x
  8136. +1 ^^ y
  8137. +2 ^ ^ z
  8138. +3 ^ ^ End of pattern
  8139. 0: xyz
  8140. \= Expect no match
  8141. abc
  8142. No match
  8143. abcxypqr
  8144. No match
  8145. /xyz/auto_callout,no_start_optimize
  8146. abcxyz
  8147. --->abcxyz
  8148. +0 ^ x
  8149. +0 ^ x
  8150. +0 ^ x
  8151. +0 ^ x
  8152. +1 ^^ y
  8153. +2 ^ ^ z
  8154. +3 ^ ^ End of pattern
  8155. 0: xyz
  8156. \= Expect no match
  8157. abc
  8158. --->abc
  8159. +0 ^ x
  8160. +0 ^ x
  8161. +0 ^ x
  8162. +0 ^ x
  8163. No match
  8164. abcxypqr
  8165. --->abcxypqr
  8166. +0 ^ x
  8167. +0 ^ x
  8168. +0 ^ x
  8169. +0 ^ x
  8170. +1 ^^ y
  8171. +2 ^ ^ z
  8172. +0 ^ x
  8173. +0 ^ x
  8174. +0 ^ x
  8175. +0 ^ x
  8176. +0 ^ x
  8177. No match
  8178. /(*NO_START_OPT)xyz/auto_callout
  8179. abcxyz
  8180. --->abcxyz
  8181. +15 ^ x
  8182. +15 ^ x
  8183. +15 ^ x
  8184. +15 ^ x
  8185. +16 ^^ y
  8186. +17 ^ ^ z
  8187. +18 ^ ^ End of pattern
  8188. 0: xyz
  8189. /(*NO_AUTO_POSSESS)a+b/B
  8190. ------------------------------------------------------------------
  8191. Bra
  8192. a+
  8193. b
  8194. Ket
  8195. End
  8196. ------------------------------------------------------------------
  8197. /xyz/auto_callout,no_start_optimize
  8198. abcxyz
  8199. --->abcxyz
  8200. +0 ^ x
  8201. +0 ^ x
  8202. +0 ^ x
  8203. +0 ^ x
  8204. +1 ^^ y
  8205. +2 ^ ^ z
  8206. +3 ^ ^ End of pattern
  8207. 0: xyz
  8208. /^"((?(?=[a])[^"])|b)*"$/auto_callout
  8209. "ab"
  8210. --->"ab"
  8211. +0 ^ ^
  8212. +1 ^ "
  8213. +2 ^^ (
  8214. +3 ^^ (?
  8215. +5 ^^ (?=
  8216. +8 ^^ [a]
  8217. +11 ^ ^ )
  8218. +12 ^^ [^"]
  8219. +16 ^ ^ )
  8220. +17 ^ ^ |
  8221. +3 ^ ^ (?
  8222. +5 ^ ^ (?=
  8223. +8 ^ ^ [a]
  8224. +17 ^ ^ |
  8225. +21 ^ ^ "
  8226. +18 ^ ^ b
  8227. +19 ^ ^ )*
  8228. +3 ^ ^ (?
  8229. +5 ^ ^ (?=
  8230. +8 ^ ^ [a]
  8231. +17 ^ ^ |
  8232. +21 ^ ^ "
  8233. +22 ^ ^ $
  8234. +23 ^ ^ End of pattern
  8235. 0: "ab"
  8236. 1:
  8237. /^"((?(?=[a])[^"])|b)*"$/
  8238. "ab"
  8239. 0: "ab"
  8240. 1:
  8241. /^X(?5)(a)(?|(b)|(q))(c)(d)Y/
  8242. Failed: error 115 at offset 5: reference to non-existent subpattern
  8243. XYabcdY
  8244. /^X(?&N)(a)(?|(b)|(q))(c)(d)(?<N>Y)/
  8245. XYabcdY
  8246. 0: XYabcdY
  8247. 1: a
  8248. 2: b
  8249. 3: c
  8250. 4: d
  8251. 5: Y
  8252. /Xa{2,4}b/
  8253. X\=ps
  8254. Partial match: X
  8255. Xa\=ps
  8256. Partial match: Xa
  8257. Xaa\=ps
  8258. Partial match: Xaa
  8259. Xaaa\=ps
  8260. Partial match: Xaaa
  8261. Xaaaa\=ps
  8262. Partial match: Xaaaa
  8263. /Xa{2,4}?b/
  8264. X\=ps
  8265. Partial match: X
  8266. Xa\=ps
  8267. Partial match: Xa
  8268. Xaa\=ps
  8269. Partial match: Xaa
  8270. Xaaa\=ps
  8271. Partial match: Xaaa
  8272. Xaaaa\=ps
  8273. Partial match: Xaaaa
  8274. /Xa{2,4}+b/
  8275. X\=ps
  8276. Partial match: X
  8277. Xa\=ps
  8278. Partial match: Xa
  8279. Xaa\=ps
  8280. Partial match: Xaa
  8281. Xaaa\=ps
  8282. Partial match: Xaaa
  8283. Xaaaa\=ps
  8284. Partial match: Xaaaa
  8285. /X\d{2,4}b/
  8286. X\=ps
  8287. Partial match: X
  8288. X3\=ps
  8289. Partial match: X3
  8290. X33\=ps
  8291. Partial match: X33
  8292. X333\=ps
  8293. Partial match: X333
  8294. X3333\=ps
  8295. Partial match: X3333
  8296. /X\d{2,4}?b/
  8297. X\=ps
  8298. Partial match: X
  8299. X3\=ps
  8300. Partial match: X3
  8301. X33\=ps
  8302. Partial match: X33
  8303. X333\=ps
  8304. Partial match: X333
  8305. X3333\=ps
  8306. Partial match: X3333
  8307. /X\d{2,4}+b/
  8308. X\=ps
  8309. Partial match: X
  8310. X3\=ps
  8311. Partial match: X3
  8312. X33\=ps
  8313. Partial match: X33
  8314. X333\=ps
  8315. Partial match: X333
  8316. X3333\=ps
  8317. Partial match: X3333
  8318. /X\D{2,4}b/
  8319. X\=ps
  8320. Partial match: X
  8321. Xa\=ps
  8322. Partial match: Xa
  8323. Xaa\=ps
  8324. Partial match: Xaa
  8325. Xaaa\=ps
  8326. Partial match: Xaaa
  8327. Xaaaa\=ps
  8328. Partial match: Xaaaa
  8329. /X\D{2,4}?b/
  8330. X\=ps
  8331. Partial match: X
  8332. Xa\=ps
  8333. Partial match: Xa
  8334. Xaa\=ps
  8335. Partial match: Xaa
  8336. Xaaa\=ps
  8337. Partial match: Xaaa
  8338. Xaaaa\=ps
  8339. Partial match: Xaaaa
  8340. /X\D{2,4}+b/
  8341. X\=ps
  8342. Partial match: X
  8343. Xa\=ps
  8344. Partial match: Xa
  8345. Xaa\=ps
  8346. Partial match: Xaa
  8347. Xaaa\=ps
  8348. Partial match: Xaaa
  8349. Xaaaa\=ps
  8350. Partial match: Xaaaa
  8351. /X[abc]{2,4}b/
  8352. X\=ps
  8353. Partial match: X
  8354. Xa\=ps
  8355. Partial match: Xa
  8356. Xaa\=ps
  8357. Partial match: Xaa
  8358. Xaaa\=ps
  8359. Partial match: Xaaa
  8360. Xaaaa\=ps
  8361. Partial match: Xaaaa
  8362. /X[abc]{2,4}?b/
  8363. X\=ps
  8364. Partial match: X
  8365. Xa\=ps
  8366. Partial match: Xa
  8367. Xaa\=ps
  8368. Partial match: Xaa
  8369. Xaaa\=ps
  8370. Partial match: Xaaa
  8371. Xaaaa\=ps
  8372. Partial match: Xaaaa
  8373. /X[abc]{2,4}+b/
  8374. X\=ps
  8375. Partial match: X
  8376. Xa\=ps
  8377. Partial match: Xa
  8378. Xaa\=ps
  8379. Partial match: Xaa
  8380. Xaaa\=ps
  8381. Partial match: Xaaa
  8382. Xaaaa\=ps
  8383. Partial match: Xaaaa
  8384. /X[^a]{2,4}b/
  8385. X\=ps
  8386. Partial match: X
  8387. Xz\=ps
  8388. Partial match: Xz
  8389. Xzz\=ps
  8390. Partial match: Xzz
  8391. Xzzz\=ps
  8392. Partial match: Xzzz
  8393. Xzzzz\=ps
  8394. Partial match: Xzzzz
  8395. /X[^a]{2,4}?b/
  8396. X\=ps
  8397. Partial match: X
  8398. Xz\=ps
  8399. Partial match: Xz
  8400. Xzz\=ps
  8401. Partial match: Xzz
  8402. Xzzz\=ps
  8403. Partial match: Xzzz
  8404. Xzzzz\=ps
  8405. Partial match: Xzzzz
  8406. /X[^a]{2,4}+b/
  8407. X\=ps
  8408. Partial match: X
  8409. Xz\=ps
  8410. Partial match: Xz
  8411. Xzz\=ps
  8412. Partial match: Xzz
  8413. Xzzz\=ps
  8414. Partial match: Xzzz
  8415. Xzzzz\=ps
  8416. Partial match: Xzzzz
  8417. /(Y)X\1{2,4}b/
  8418. YX\=ps
  8419. Partial match: YX
  8420. YXY\=ps
  8421. Partial match: YXY
  8422. YXYY\=ps
  8423. Partial match: YXYY
  8424. YXYYY\=ps
  8425. Partial match: YXYYY
  8426. YXYYYY\=ps
  8427. Partial match: YXYYYY
  8428. /(Y)X\1{2,4}?b/
  8429. YX\=ps
  8430. Partial match: YX
  8431. YXY\=ps
  8432. Partial match: YXY
  8433. YXYY\=ps
  8434. Partial match: YXYY
  8435. YXYYY\=ps
  8436. Partial match: YXYYY
  8437. YXYYYY\=ps
  8438. Partial match: YXYYYY
  8439. /(Y)X\1{2,4}+b/
  8440. YX\=ps
  8441. Partial match: YX
  8442. YXY\=ps
  8443. Partial match: YXY
  8444. YXYY\=ps
  8445. Partial match: YXYY
  8446. YXYYY\=ps
  8447. Partial match: YXYYY
  8448. YXYYYY\=ps
  8449. Partial match: YXYYYY
  8450. /\++\KZ|\d+X|9+Y/startchar
  8451. ++++123999\=ps
  8452. Partial match: 123999
  8453. ++++123999Y\=ps
  8454. 0: 999Y
  8455. ++++Z1234\=ps
  8456. 0: ++++Z
  8457. ^^^^
  8458. /Z(*F)/
  8459. \= Expect no match
  8460. Z\=ps
  8461. No match
  8462. ZA\=ps
  8463. No match
  8464. /Z(?!)/
  8465. \= Expect no match
  8466. Z\=ps
  8467. No match
  8468. ZA\=ps
  8469. No match
  8470. /dog(sbody)?/
  8471. dogs\=ps
  8472. 0: dog
  8473. dogs\=ph
  8474. Partial match: dogs
  8475. /dog(sbody)??/
  8476. dogs\=ps
  8477. 0: dog
  8478. dogs\=ph
  8479. 0: dog
  8480. /dog|dogsbody/
  8481. dogs\=ps
  8482. 0: dog
  8483. dogs\=ph
  8484. 0: dog
  8485. /dogsbody|dog/
  8486. dogs\=ps
  8487. 0: dog
  8488. dogs\=ph
  8489. Partial match: dogs
  8490. /\bthe cat\b/
  8491. the cat\=ps
  8492. 0: the cat
  8493. the cat\=ph
  8494. Partial match: the cat
  8495. /abc/
  8496. abc\=ps
  8497. 0: abc
  8498. abc\=ph
  8499. 0: abc
  8500. /abc\K123/startchar
  8501. xyzabc123pqr
  8502. 0: abc123
  8503. ^^^
  8504. xyzabc12\=ps
  8505. Partial match: abc12
  8506. xyzabc12\=ph
  8507. Partial match: abc12
  8508. /(?<=abc)123/
  8509. xyzabc123pqr
  8510. 0: 123
  8511. xyzabc12\=ps
  8512. Partial match: 12
  8513. xyzabc12\=ph
  8514. Partial match: 12
  8515. /\babc\b/
  8516. +++abc+++
  8517. 0: abc
  8518. +++ab\=ps
  8519. Partial match: ab
  8520. +++ab\=ph
  8521. Partial match: ab
  8522. /(?&word)(?&element)(?(DEFINE)(?<element><[^m][^>]>[^<])(?<word>\w*+))/B
  8523. ------------------------------------------------------------------
  8524. Bra
  8525. Recurse
  8526. Recurse
  8527. Cond
  8528. Cond false
  8529. CBra 1
  8530. <
  8531. [^m]
  8532. [^>]
  8533. >
  8534. [^<]
  8535. Ket
  8536. CBra 2
  8537. \w*+
  8538. Ket
  8539. Ket
  8540. Ket
  8541. End
  8542. ------------------------------------------------------------------
  8543. /(?&word)(?&element)(?(DEFINE)(?<element><[^\d][^>]>[^<])(?<word>\w*+))/B
  8544. ------------------------------------------------------------------
  8545. Bra
  8546. Recurse
  8547. Recurse
  8548. Cond
  8549. Cond false
  8550. CBra 1
  8551. <
  8552. [\x00-/:-\xff] (neg)
  8553. [^>]
  8554. >
  8555. [^<]
  8556. Ket
  8557. CBra 2
  8558. \w*+
  8559. Ket
  8560. Ket
  8561. Ket
  8562. End
  8563. ------------------------------------------------------------------
  8564. /(ab)(x(y)z(cd(*ACCEPT)))pq/B
  8565. ------------------------------------------------------------------
  8566. Bra
  8567. CBra 1
  8568. ab
  8569. Ket
  8570. CBra 2
  8571. x
  8572. CBra 3
  8573. y
  8574. Ket
  8575. z
  8576. CBra 4
  8577. cd
  8578. Close 4
  8579. Close 2
  8580. *ACCEPT
  8581. Ket
  8582. Ket
  8583. pq
  8584. Ket
  8585. End
  8586. ------------------------------------------------------------------
  8587. /abc\K/aftertext,startchar
  8588. abcdef
  8589. 0: abc
  8590. ^^^
  8591. 0+ def
  8592. abcdef\=notempty_atstart
  8593. 0: abc
  8594. ^^^
  8595. 0+ def
  8596. xyzabcdef\=notempty_atstart
  8597. 0: abc
  8598. ^^^
  8599. 0+ def
  8600. \= Expect no match
  8601. abcdef\=notempty
  8602. No match
  8603. xyzabcdef\=notempty
  8604. No match
  8605. /^(?:(?=abc)|abc\K)/aftertext,startchar
  8606. abcdef
  8607. 0:
  8608. 0+ abcdef
  8609. abcdef\=notempty_atstart
  8610. 0: abc
  8611. ^^^
  8612. 0+ def
  8613. \= Expect no match
  8614. abcdef\=notempty
  8615. No match
  8616. /a?b?/aftertext
  8617. xyz
  8618. 0:
  8619. 0+ xyz
  8620. xyzabc
  8621. 0:
  8622. 0+ xyzabc
  8623. xyzabc\=notempty
  8624. 0: ab
  8625. 0+ c
  8626. xyzabc\=notempty_atstart
  8627. 0:
  8628. 0+ yzabc
  8629. xyz\=notempty_atstart
  8630. 0:
  8631. 0+ yz
  8632. \= Expect no match
  8633. xyz\=notempty
  8634. No match
  8635. /^a?b?/aftertext
  8636. xyz
  8637. 0:
  8638. 0+ xyz
  8639. xyzabc
  8640. 0:
  8641. 0+ xyzabc
  8642. \= Expect no match
  8643. xyzabc\=notempty
  8644. No match
  8645. xyzabc\=notempty_atstart
  8646. No match
  8647. xyz\=notempty_atstart
  8648. No match
  8649. xyz\=notempty
  8650. No match
  8651. /^(?<name>a|b\g<name>c)/
  8652. aaaa
  8653. 0: a
  8654. 1: a
  8655. bacxxx
  8656. 0: bac
  8657. 1: bac
  8658. bbaccxxx
  8659. 0: bbacc
  8660. 1: bbacc
  8661. bbbacccxx
  8662. 0: bbbaccc
  8663. 1: bbbaccc
  8664. /^(?<name>a|b\g'name'c)/
  8665. aaaa
  8666. 0: a
  8667. 1: a
  8668. bacxxx
  8669. 0: bac
  8670. 1: bac
  8671. bbaccxxx
  8672. 0: bbacc
  8673. 1: bbacc
  8674. bbbacccxx
  8675. 0: bbbaccc
  8676. 1: bbbaccc
  8677. /^(a|b\g<1>c)/
  8678. aaaa
  8679. 0: a
  8680. 1: a
  8681. bacxxx
  8682. 0: bac
  8683. 1: bac
  8684. bbaccxxx
  8685. 0: bbacc
  8686. 1: bbacc
  8687. bbbacccxx
  8688. 0: bbbaccc
  8689. 1: bbbaccc
  8690. /^(a|b\g'1'c)/
  8691. aaaa
  8692. 0: a
  8693. 1: a
  8694. bacxxx
  8695. 0: bac
  8696. 1: bac
  8697. bbaccxxx
  8698. 0: bbacc
  8699. 1: bbacc
  8700. bbbacccxx
  8701. 0: bbbaccc
  8702. 1: bbbaccc
  8703. /^(a|b\g'-1'c)/
  8704. aaaa
  8705. 0: a
  8706. 1: a
  8707. bacxxx
  8708. 0: bac
  8709. 1: bac
  8710. bbaccxxx
  8711. 0: bbacc
  8712. 1: bbacc
  8713. bbbacccxx
  8714. 0: bbbaccc
  8715. 1: bbbaccc
  8716. /(^(a|b\g<-1>c))/
  8717. aaaa
  8718. 0: a
  8719. 1: a
  8720. 2: a
  8721. bacxxx
  8722. 0: bac
  8723. 1: bac
  8724. 2: bac
  8725. bbaccxxx
  8726. 0: bbacc
  8727. 1: bbacc
  8728. 2: bbacc
  8729. bbbacccxx
  8730. 0: bbbaccc
  8731. 1: bbbaccc
  8732. 2: bbbaccc
  8733. /(?-i:\g<name>)(?i:(?<name>a))/
  8734. XaaX
  8735. 0: aa
  8736. 1: a
  8737. XAAX
  8738. 0: AA
  8739. 1: A
  8740. /(?i:\g<name>)(?-i:(?<name>a))/
  8741. XaaX
  8742. 0: aa
  8743. 1: a
  8744. \= Expect no match
  8745. XAAX
  8746. No match
  8747. /(?-i:\g<+1>)(?i:(a))/
  8748. XaaX
  8749. 0: aa
  8750. 1: a
  8751. XAAX
  8752. 0: AA
  8753. 1: A
  8754. /(?=(?<regex>(?#simplesyntax)\$(?<name>[a-zA-Z_\x{7f}-\x{ff}][a-zA-Z0-9_\x{7f}-\x{ff}]*)(?:\[(?<index>[a-zA-Z0-9_\x{7f}-\x{ff}]+|\$\g<name>)\]|->\g<name>(\(.*?\))?)?|(?#simple syntax withbraces)\$\{(?:\g<name>(?<indices>\[(?:\g<index>|'(?:\\.|[^'\\])*'|"(?:\g<regex>|\\.|[^"\\])*")\])?|\g<complex>|\$\{\g<complex>\})\}|(?#complexsyntax)\{(?<complex>\$(?<segment>\g<name>(\g<indices>*|\(.*?\))?)(?:->\g<segment>)*|\$\g<complex>|\$\{\g<complex>\})\}))\{/
  8755. /(?<n>a|b|c)\g<n>*/
  8756. abc
  8757. 0: abc
  8758. 1: a
  8759. accccbbb
  8760. 0: accccbbb
  8761. 1: a
  8762. /^X(?7)(a)(?|(b)|(q)(r)(s))(c)(d)(Y)/
  8763. XYabcdY
  8764. 0: XYabcdY
  8765. 1: a
  8766. 2: b
  8767. 3: <unset>
  8768. 4: <unset>
  8769. 5: c
  8770. 6: d
  8771. 7: Y
  8772. /(?<=b(?1)|zzz)(a)/
  8773. xbaax
  8774. 0: a
  8775. 1: a
  8776. xzzzax
  8777. 0: a
  8778. 1: a
  8779. /(a)(?<=b\1)/
  8780. /(a)(?<=b+(?1))/
  8781. Failed: error 125 at offset 3: lookbehind assertion is not fixed length
  8782. /(a+)(?<=b(?1))/
  8783. Failed: error 125 at offset 4: lookbehind assertion is not fixed length
  8784. /(a(?<=b(?1)))/
  8785. Failed: error 125 at offset 2: lookbehind assertion is not fixed length
  8786. /(?<=b(?1))xyz/
  8787. Failed: error 115 at offset 8: reference to non-existent subpattern
  8788. /(?<=b(?1))xyz(b+)pqrstuvew/
  8789. Failed: error 125 at offset 0: lookbehind assertion is not fixed length
  8790. /(a|bc)\1/I
  8791. Capture group count = 1
  8792. Max back reference = 1
  8793. Starting code units: a b
  8794. Subject length lower bound = 2
  8795. /(a|bc)\1{2,3}/I
  8796. Capture group count = 1
  8797. Max back reference = 1
  8798. Starting code units: a b
  8799. Subject length lower bound = 3
  8800. /(a|bc)(?1)/I
  8801. Capture group count = 1
  8802. Starting code units: a b
  8803. Subject length lower bound = 2
  8804. /(a|b\1)(a|b\1)/I
  8805. Capture group count = 2
  8806. Max back reference = 1
  8807. Starting code units: a b
  8808. Subject length lower bound = 2
  8809. /(a|b\1){2}/I
  8810. Capture group count = 1
  8811. Max back reference = 1
  8812. Starting code units: a b
  8813. Subject length lower bound = 2
  8814. /(a|bbbb\1)(a|bbbb\1)/I
  8815. Capture group count = 2
  8816. Max back reference = 1
  8817. Starting code units: a b
  8818. Subject length lower bound = 2
  8819. /(a|bbbb\1){2}/I
  8820. Capture group count = 1
  8821. Max back reference = 1
  8822. Starting code units: a b
  8823. Subject length lower bound = 2
  8824. /^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]/I
  8825. Capture group count = 1
  8826. Compile options: <none>
  8827. Overall options: anchored
  8828. First code unit = 'F'
  8829. Last code unit = ':'
  8830. Subject length lower bound = 22
  8831. /<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>/Iis
  8832. Capture group count = 11
  8833. Options: caseless dotall
  8834. First code unit = '<'
  8835. Last code unit = '>'
  8836. Subject length lower bound = 47
  8837. "(?>.*/)foo"I
  8838. Capture group count = 0
  8839. Last code unit = 'o'
  8840. Subject length lower bound = 4
  8841. /(?(?=[^a-z]+[a-z]) \d{2}-[a-z]{3}-\d{2} | \d{2}-\d{2}-\d{2} ) /Ix
  8842. Capture group count = 0
  8843. Options: extended
  8844. Last code unit = '-'
  8845. Subject length lower bound = 8
  8846. /(?:(?:(?:(?:(?:(?:(?:(?:(?:(a|b|c))))))))))/Ii
  8847. Capture group count = 1
  8848. Options: caseless
  8849. Starting code units: A B C a b c
  8850. Subject length lower bound = 1
  8851. /(?:c|d)(?:)(?:aaaaaaaa(?:)(?:bbbbbbbb)(?:bbbbbbbb(?:))(?:bbbbbbbb(?:)(?:bbbbbbbb)))/I
  8852. Capture group count = 0
  8853. Starting code units: c d
  8854. Last code unit = 'b'
  8855. Subject length lower bound = 41
  8856. /<a[\s]+href[\s]*=[\s]* # find <a href=
  8857. ([\"\'])? # find single or double quote
  8858. (?(1) (.*?)\1 | ([^\s]+)) # if quote found, match up to next matching
  8859. # quote, otherwise match up to next space
  8860. /Iisx
  8861. Capture group count = 3
  8862. Max back reference = 1
  8863. Options: caseless dotall extended
  8864. First code unit = '<'
  8865. Last code unit = '='
  8866. Subject length lower bound = 9
  8867. /^(?!:) # colon disallowed at start
  8868. (?: # start of item
  8869. (?: [0-9a-f]{1,4} | # 1-4 hex digits or
  8870. (?(1)0 | () ) ) # if null previously matched, fail; else null
  8871. : # followed by colon
  8872. ){1,7} # end item; 1-7 of them required
  8873. [0-9a-f]{1,4} $ # final hex number at end of string
  8874. (?(1)|.) # check that there was an empty component
  8875. /Iix
  8876. Capture group count = 1
  8877. Max back reference = 1
  8878. Compile options: caseless extended
  8879. Overall options: anchored caseless extended
  8880. Last code unit = ':'
  8881. Subject length lower bound = 2
  8882. /(?|(?<a>A)|(?<a>B))/I
  8883. Capture group count = 1
  8884. Named capture groups:
  8885. a 1
  8886. Starting code units: A B
  8887. Subject length lower bound = 1
  8888. AB\=copy=a
  8889. 0: A
  8890. 1: A
  8891. C A (1) a (group 1)
  8892. BA\=copy=a
  8893. 0: B
  8894. 1: B
  8895. C B (1) a (group 1)
  8896. /(?|(?<a>A)|(?<b>B))/
  8897. Failed: error 165 at offset 16: different names for subpatterns of the same number are not allowed
  8898. /(?:a(?<quote> (?<apostrophe>')|(?<realquote>")) |
  8899. b(?<quote> (?<apostrophe>')|(?<realquote>")) )
  8900. (?('quote')[a-z]+|[0-9]+)/Ix,dupnames
  8901. Capture group count = 6
  8902. Max back reference = 4
  8903. Named capture groups:
  8904. apostrophe 2
  8905. apostrophe 5
  8906. quote 1
  8907. quote 4
  8908. realquote 3
  8909. realquote 6
  8910. Options: dupnames extended
  8911. Starting code units: a b
  8912. Subject length lower bound = 3
  8913. a"aaaaa
  8914. 0: a"aaaaa
  8915. 1: "
  8916. 2: <unset>
  8917. 3: "
  8918. b"aaaaa
  8919. 0: b"aaaaa
  8920. 1: <unset>
  8921. 2: <unset>
  8922. 3: <unset>
  8923. 4: "
  8924. 5: <unset>
  8925. 6: "
  8926. \= Expect no match
  8927. b"11111
  8928. No match
  8929. a"11111
  8930. No match
  8931. /^(?|(a)(b)(c)(?<D>d)|(?<D>e)) (?('D')X|Y)/IBx,dupnames
  8932. ------------------------------------------------------------------
  8933. Bra
  8934. ^
  8935. Bra
  8936. CBra 1
  8937. a
  8938. Ket
  8939. CBra 2
  8940. b
  8941. Ket
  8942. CBra 3
  8943. c
  8944. Ket
  8945. CBra 4
  8946. d
  8947. Ket
  8948. Alt
  8949. CBra 1
  8950. e
  8951. Ket
  8952. Ket
  8953. Cond
  8954. Cond ref <D>2
  8955. X
  8956. Alt
  8957. Y
  8958. Ket
  8959. Ket
  8960. End
  8961. ------------------------------------------------------------------
  8962. Capture group count = 4
  8963. Max back reference = 4
  8964. Named capture groups:
  8965. D 4
  8966. D 1
  8967. Compile options: dupnames extended
  8968. Overall options: anchored dupnames extended
  8969. Starting code units: a e
  8970. Subject length lower bound = 2
  8971. abcdX
  8972. 0: abcdX
  8973. 1: a
  8974. 2: b
  8975. 3: c
  8976. 4: d
  8977. eX
  8978. 0: eX
  8979. 1: e
  8980. \= Expect no match
  8981. abcdY
  8982. No match
  8983. ey
  8984. No match
  8985. /(?<A>a) (b)(c) (?<A>d (?(R&A)$ | (?4)) )/IBx,dupnames
  8986. ------------------------------------------------------------------
  8987. Bra
  8988. CBra 1
  8989. a
  8990. Ket
  8991. CBra 2
  8992. b
  8993. Ket
  8994. CBra 3
  8995. c
  8996. Ket
  8997. CBra 4
  8998. d
  8999. Cond
  9000. Cond recurse <A>2
  9001. $
  9002. Alt
  9003. Recurse
  9004. Ket
  9005. Ket
  9006. Ket
  9007. End
  9008. ------------------------------------------------------------------
  9009. Capture group count = 4
  9010. Max back reference = 4
  9011. Named capture groups:
  9012. A 1
  9013. A 4
  9014. Options: dupnames extended
  9015. First code unit = 'a'
  9016. Last code unit = 'd'
  9017. Subject length lower bound = 4
  9018. abcdd
  9019. 0: abcdd
  9020. 1: a
  9021. 2: b
  9022. 3: c
  9023. 4: dd
  9024. \= Expect no match
  9025. abcdde
  9026. No match
  9027. /abcd*/
  9028. xxxxabcd\=ps
  9029. 0: abcd
  9030. xxxxabcd\=ph
  9031. Partial match: abcd
  9032. /abcd*/i
  9033. xxxxabcd\=ps
  9034. 0: abcd
  9035. xxxxabcd\=ph
  9036. Partial match: abcd
  9037. XXXXABCD\=ps
  9038. 0: ABCD
  9039. XXXXABCD\=ph
  9040. Partial match: ABCD
  9041. /abc\d*/
  9042. xxxxabc1\=ps
  9043. 0: abc1
  9044. xxxxabc1\=ph
  9045. Partial match: abc1
  9046. /(a)bc\1*/
  9047. xxxxabca\=ps
  9048. 0: abca
  9049. 1: a
  9050. xxxxabca\=ph
  9051. Partial match: abca
  9052. /abc[de]*/
  9053. xxxxabcde\=ps
  9054. 0: abcde
  9055. xxxxabcde\=ph
  9056. Partial match: abcde
  9057. /(\3)(\1)(a)/allow_empty_class,match_unset_backref,dupnames
  9058. cat
  9059. 0: a
  9060. 1:
  9061. 2:
  9062. 3: a
  9063. /(\3)(\1)(a)/I,allow_empty_class,match_unset_backref,dupnames
  9064. Capture group count = 3
  9065. Max back reference = 3
  9066. Options: allow_empty_class dupnames match_unset_backref
  9067. Last code unit = 'a'
  9068. Subject length lower bound = 1
  9069. cat
  9070. 0: a
  9071. 1:
  9072. 2:
  9073. 3: a
  9074. /(\3)(\1)(a)/I
  9075. Capture group count = 3
  9076. Max back reference = 3
  9077. Last code unit = 'a'
  9078. Subject length lower bound = 3
  9079. \= Expect no match
  9080. cat
  9081. No match
  9082. /i(?(DEFINE)(?<s>a))/I
  9083. Capture group count = 1
  9084. Named capture groups:
  9085. s 1
  9086. First code unit = 'i'
  9087. Subject length lower bound = 1
  9088. i
  9089. 0: i
  9090. /()i(?(1)a)/I
  9091. Capture group count = 1
  9092. Max back reference = 1
  9093. First code unit = 'i'
  9094. Subject length lower bound = 1
  9095. ia
  9096. 0: ia
  9097. 1:
  9098. /(?i)a(?-i)b|c/B
  9099. ------------------------------------------------------------------
  9100. Bra
  9101. /i a
  9102. b
  9103. Alt
  9104. c
  9105. Ket
  9106. End
  9107. ------------------------------------------------------------------
  9108. XabX
  9109. 0: ab
  9110. XAbX
  9111. 0: Ab
  9112. CcC
  9113. 0: c
  9114. \= Expect no match
  9115. XABX
  9116. No match
  9117. /(?i)a(?s)b|c/B
  9118. ------------------------------------------------------------------
  9119. Bra
  9120. /i ab
  9121. Alt
  9122. /i c
  9123. Ket
  9124. End
  9125. ------------------------------------------------------------------
  9126. /(?i)a(?s-i)b|c/B
  9127. ------------------------------------------------------------------
  9128. Bra
  9129. /i a
  9130. b
  9131. Alt
  9132. c
  9133. Ket
  9134. End
  9135. ------------------------------------------------------------------
  9136. /^(ab(c\1)d|x){2}$/B
  9137. ------------------------------------------------------------------
  9138. Bra
  9139. ^
  9140. CBra 1
  9141. ab
  9142. CBra 2
  9143. c
  9144. \1
  9145. Ket
  9146. d
  9147. Alt
  9148. x
  9149. Ket
  9150. CBra 1
  9151. ab
  9152. CBra 2
  9153. c
  9154. \1
  9155. Ket
  9156. d
  9157. Alt
  9158. x
  9159. Ket
  9160. $
  9161. Ket
  9162. End
  9163. ------------------------------------------------------------------
  9164. xabcxd
  9165. 0: xabcxd
  9166. 1: abcxd
  9167. 2: cx
  9168. /^(?&t)*+(?(DEFINE)(?<t>.))$/B
  9169. ------------------------------------------------------------------
  9170. Bra
  9171. ^
  9172. Braposzero
  9173. SBraPos
  9174. Recurse
  9175. KetRpos
  9176. Cond
  9177. Cond false
  9178. CBra 1
  9179. Any
  9180. Ket
  9181. Ket
  9182. $
  9183. Ket
  9184. End
  9185. ------------------------------------------------------------------
  9186. /^(?&t)*(?(DEFINE)(?<t>.))$/B
  9187. ------------------------------------------------------------------
  9188. Bra
  9189. ^
  9190. Brazero
  9191. SBra
  9192. Recurse
  9193. KetRmax
  9194. Cond
  9195. Cond false
  9196. CBra 1
  9197. Any
  9198. Ket
  9199. Ket
  9200. $
  9201. Ket
  9202. End
  9203. ------------------------------------------------------------------
  9204. # This one is here because Perl gives the match as "b" rather than "ab". I
  9205. # believe this to be a Perl bug.
  9206. /(?>a\Kb)z|(ab)/
  9207. ab\=startchar
  9208. 0: ab
  9209. 1: ab
  9210. /(?P<L1>(?P<L2>0|)|(?P>L2)(?P>L1))/
  9211. abcd
  9212. 0:
  9213. 1:
  9214. 2:
  9215. 0abc
  9216. 0: 0
  9217. 1: 0
  9218. 2: 0
  9219. /abc(*MARK:)pqr/
  9220. Failed: error 166 at offset 10: (*MARK) must have an argument
  9221. /abc(*:)pqr/
  9222. Failed: error 166 at offset 6: (*MARK) must have an argument
  9223. /(*COMMIT:X)/B
  9224. ------------------------------------------------------------------
  9225. Bra
  9226. *COMMIT X
  9227. Ket
  9228. End
  9229. ------------------------------------------------------------------
  9230. # This should, and does, fail. In Perl, it does not, which I think is a
  9231. # bug because replacing the B in the pattern by (B|D) does make it fail.
  9232. # Turning off Perl's optimization by inserting (??{""}) also makes it fail.
  9233. /A(*COMMIT)B/aftertext,mark
  9234. \= Expect no match
  9235. ACABX
  9236. No match
  9237. # These should be different, but in Perl they are not, which I think
  9238. # is a bug in Perl.
  9239. /A(*THEN)B|A(*THEN)C/mark
  9240. AC
  9241. 0: AC
  9242. /A(*PRUNE)B|A(*PRUNE)C/mark
  9243. \= Expect no match
  9244. AC
  9245. No match
  9246. # Mark names can be duplicated. Perl doesn't give a mark for this one,
  9247. # though PCRE2 does.
  9248. /^A(*:A)B|^X(*:A)Y/mark
  9249. \= Expect no match
  9250. XAQQ
  9251. No match, mark = A
  9252. # COMMIT at the start of a pattern should be the same as an anchor. Perl
  9253. # optimizations defeat this. So does the PCRE2 optimization unless we disable
  9254. # it.
  9255. /(*COMMIT)ABC/
  9256. ABCDEFG
  9257. 0: ABC
  9258. /(*COMMIT)ABC/no_start_optimize
  9259. \= Expect no match
  9260. DEFGABC
  9261. No match
  9262. /^(ab (c+(*THEN)cd) | xyz)/x
  9263. \= Expect no match
  9264. abcccd
  9265. No match
  9266. /^(ab (c+(*PRUNE)cd) | xyz)/x
  9267. \= Expect no match
  9268. abcccd
  9269. No match
  9270. /^(ab (c+(*FAIL)cd) | xyz)/x
  9271. \= Expect no match
  9272. abcccd
  9273. No match
  9274. # Perl gets some of these wrong
  9275. /(?>.(*ACCEPT))*?5/
  9276. abcde
  9277. 0: a
  9278. /(.(*ACCEPT))*?5/
  9279. abcde
  9280. 0: a
  9281. 1: a
  9282. /(.(*ACCEPT))5/
  9283. abcde
  9284. 0: a
  9285. 1: a
  9286. /(.(*ACCEPT))*5/
  9287. abcde
  9288. 0: a
  9289. 1: a
  9290. /A\NB./B
  9291. ------------------------------------------------------------------
  9292. Bra
  9293. A
  9294. Any
  9295. B
  9296. Any
  9297. Ket
  9298. End
  9299. ------------------------------------------------------------------
  9300. ACBD
  9301. 0: ACBD
  9302. \= Expect no match
  9303. A\nB
  9304. No match
  9305. ACB\n
  9306. No match
  9307. /A\NB./Bs
  9308. ------------------------------------------------------------------
  9309. Bra
  9310. A
  9311. Any
  9312. B
  9313. AllAny
  9314. Ket
  9315. End
  9316. ------------------------------------------------------------------
  9317. ACBD
  9318. 0: ACBD
  9319. ACB\n
  9320. 0: ACB\x0a
  9321. \= Expect no match
  9322. A\nB
  9323. No match
  9324. /A\NB/newline=crlf
  9325. A\nB
  9326. 0: A\x0aB
  9327. A\rB
  9328. 0: A\x0dB
  9329. \= Expect no match
  9330. A\r\nB
  9331. No match
  9332. /\R+b/B
  9333. ------------------------------------------------------------------
  9334. Bra
  9335. \R++
  9336. b
  9337. Ket
  9338. End
  9339. ------------------------------------------------------------------
  9340. /\R+\n/B
  9341. ------------------------------------------------------------------
  9342. Bra
  9343. \R+
  9344. \x0a
  9345. Ket
  9346. End
  9347. ------------------------------------------------------------------
  9348. /\R+\d/B
  9349. ------------------------------------------------------------------
  9350. Bra
  9351. \R++
  9352. \d
  9353. Ket
  9354. End
  9355. ------------------------------------------------------------------
  9356. /\d*\R/B
  9357. ------------------------------------------------------------------
  9358. Bra
  9359. \d*+
  9360. \R
  9361. Ket
  9362. End
  9363. ------------------------------------------------------------------
  9364. /\s*\R/B
  9365. ------------------------------------------------------------------
  9366. Bra
  9367. \s*
  9368. \R
  9369. Ket
  9370. End
  9371. ------------------------------------------------------------------
  9372. \x20\x0a
  9373. 0: \x0a
  9374. \x20\x0d
  9375. 0: \x0d
  9376. \x20\x0d\x0a
  9377. 0: \x0d\x0a
  9378. /\S*\R/B
  9379. ------------------------------------------------------------------
  9380. Bra
  9381. \S*+
  9382. \R
  9383. Ket
  9384. End
  9385. ------------------------------------------------------------------
  9386. a\x0a
  9387. 0: a\x0a
  9388. /X\h*\R/B
  9389. ------------------------------------------------------------------
  9390. Bra
  9391. X
  9392. \h*+
  9393. \R
  9394. Ket
  9395. End
  9396. ------------------------------------------------------------------
  9397. X\x20\x0a
  9398. 0: X \x0a
  9399. /X\H*\R/B
  9400. ------------------------------------------------------------------
  9401. Bra
  9402. X
  9403. \H*
  9404. \R
  9405. Ket
  9406. End
  9407. ------------------------------------------------------------------
  9408. X\x0d\x0a
  9409. 0: X\x0d\x0a
  9410. /X\H+\R/B
  9411. ------------------------------------------------------------------
  9412. Bra
  9413. X
  9414. \H+
  9415. \R
  9416. Ket
  9417. End
  9418. ------------------------------------------------------------------
  9419. X\x0d\x0a
  9420. 0: X\x0d\x0a
  9421. /X\H++\R/B
  9422. ------------------------------------------------------------------
  9423. Bra
  9424. X
  9425. \H++
  9426. \R
  9427. Ket
  9428. End
  9429. ------------------------------------------------------------------
  9430. \= Expect no match
  9431. X\x0d\x0a
  9432. No match
  9433. /(?<=abc)def/
  9434. abc\=ph
  9435. Partial match:
  9436. /abc$/
  9437. abc
  9438. 0: abc
  9439. abc\=ps
  9440. 0: abc
  9441. abc\=ph
  9442. Partial match: abc
  9443. /abc$/m
  9444. abc
  9445. 0: abc
  9446. abc\n
  9447. 0: abc
  9448. abc\=ph
  9449. Partial match: abc
  9450. abc\n\=ph
  9451. 0: abc
  9452. abc\=ps
  9453. 0: abc
  9454. abc\n\=ps
  9455. 0: abc
  9456. /abc\z/
  9457. abc
  9458. 0: abc
  9459. abc\=ps
  9460. 0: abc
  9461. abc\=ph
  9462. Partial match: abc
  9463. /abc\Z/
  9464. abc
  9465. 0: abc
  9466. abc\=ps
  9467. 0: abc
  9468. abc\=ph
  9469. Partial match: abc
  9470. /abc\b/
  9471. abc
  9472. 0: abc
  9473. abc\=ps
  9474. 0: abc
  9475. abc\=ph
  9476. Partial match: abc
  9477. /abc\B/
  9478. abc\=ps
  9479. Partial match: abc
  9480. abc\=ph
  9481. Partial match: abc
  9482. \= Expect no match
  9483. abc
  9484. No match
  9485. /.+/
  9486. \= Bad offsets
  9487. abc\=offset=4
  9488. Failed: error -33: bad offset value
  9489. abc\=offset=-4
  9490. ** Invalid value in 'offset=-4'
  9491. \= Valid data
  9492. abc\=offset=0
  9493. 0: abc
  9494. abc\=offset=1
  9495. 0: bc
  9496. abc\=offset=2
  9497. 0: c
  9498. \= Expect no match
  9499. abc\=offset=3
  9500. No match
  9501. /^\cģ/
  9502. Failed: error 168 at offset 3: \c must be followed by a printable ASCII character
  9503. /(?P<abn>(?P=abn)xxx)/B
  9504. ------------------------------------------------------------------
  9505. Bra
  9506. CBra 1
  9507. \1
  9508. xxx
  9509. Ket
  9510. Ket
  9511. End
  9512. ------------------------------------------------------------------
  9513. /(a\1z)/B
  9514. ------------------------------------------------------------------
  9515. Bra
  9516. CBra 1
  9517. a
  9518. \1
  9519. z
  9520. Ket
  9521. Ket
  9522. End
  9523. ------------------------------------------------------------------
  9524. /(?P<abn>(?P=abn)(?<badstufxxx)/B
  9525. Failed: error 142 at offset 29: syntax error in subpattern name (missing terminator?)
  9526. /(?P<abn>(?P=axn)xxx)/B
  9527. Failed: error 115 at offset 12: reference to non-existent subpattern
  9528. /(?P<abn>(?P=axn)xxx)(?<axn>yy)/B
  9529. ------------------------------------------------------------------
  9530. Bra
  9531. CBra 1
  9532. \2
  9533. xxx
  9534. Ket
  9535. CBra 2
  9536. yy
  9537. Ket
  9538. Ket
  9539. End
  9540. ------------------------------------------------------------------
  9541. # These tests are here because Perl gets the first one wrong.
  9542. /(\R*)(.)/s
  9543. \r\n
  9544. 0: \x0d
  9545. 1:
  9546. 2: \x0d
  9547. \r\r\n\n\r
  9548. 0: \x0d\x0d\x0a\x0a\x0d
  9549. 1: \x0d\x0d\x0a\x0a
  9550. 2: \x0d
  9551. \r\r\n\n\r\n
  9552. 0: \x0d\x0d\x0a\x0a\x0d
  9553. 1: \x0d\x0d\x0a\x0a
  9554. 2: \x0d
  9555. /(\R)*(.)/s
  9556. \r\n
  9557. 0: \x0d
  9558. 1: <unset>
  9559. 2: \x0d
  9560. \r\r\n\n\r
  9561. 0: \x0d\x0d\x0a\x0a\x0d
  9562. 1: \x0a
  9563. 2: \x0d
  9564. \r\r\n\n\r\n
  9565. 0: \x0d\x0d\x0a\x0a\x0d
  9566. 1: \x0a
  9567. 2: \x0d
  9568. /((?>\r\n|\n|\x0b|\f|\r|\x85)*)(.)/s
  9569. \r\n
  9570. 0: \x0d
  9571. 1:
  9572. 2: \x0d
  9573. \r\r\n\n\r
  9574. 0: \x0d\x0d\x0a\x0a\x0d
  9575. 1: \x0d\x0d\x0a\x0a
  9576. 2: \x0d
  9577. \r\r\n\n\r\n
  9578. 0: \x0d\x0d\x0a\x0a\x0d
  9579. 1: \x0d\x0d\x0a\x0a
  9580. 2: \x0d
  9581. # -------------
  9582. /^abc$/B
  9583. ------------------------------------------------------------------
  9584. Bra
  9585. ^
  9586. abc
  9587. $
  9588. Ket
  9589. End
  9590. ------------------------------------------------------------------
  9591. /^abc$/Bm
  9592. ------------------------------------------------------------------
  9593. Bra
  9594. /m ^
  9595. abc
  9596. /m $
  9597. Ket
  9598. End
  9599. ------------------------------------------------------------------
  9600. /^(a)*+(\w)/
  9601. aaaaX
  9602. 0: aaaaX
  9603. 1: a
  9604. 2: X
  9605. \= Expect no match
  9606. aaaa
  9607. No match
  9608. /^(?:a)*+(\w)/
  9609. aaaaX
  9610. 0: aaaaX
  9611. 1: X
  9612. \= Expect no match
  9613. aaaa
  9614. No match
  9615. /(a)++1234/IB
  9616. ------------------------------------------------------------------
  9617. Bra
  9618. CBraPos 1
  9619. a
  9620. KetRpos
  9621. 1234
  9622. Ket
  9623. End
  9624. ------------------------------------------------------------------
  9625. Capture group count = 1
  9626. First code unit = 'a'
  9627. Last code unit = '4'
  9628. Subject length lower bound = 5
  9629. /([abc])++1234/I
  9630. Capture group count = 1
  9631. Starting code units: a b c
  9632. Last code unit = '4'
  9633. Subject length lower bound = 5
  9634. /(?<=(abc)+)X/
  9635. Failed: error 125 at offset 0: lookbehind assertion is not fixed length
  9636. /(^ab)/I
  9637. Capture group count = 1
  9638. Compile options: <none>
  9639. Overall options: anchored
  9640. First code unit = 'a'
  9641. Subject length lower bound = 2
  9642. /(^ab)++/I
  9643. Capture group count = 1
  9644. Compile options: <none>
  9645. Overall options: anchored
  9646. First code unit = 'a'
  9647. Subject length lower bound = 2
  9648. /(^ab|^)+/I
  9649. Capture group count = 1
  9650. May match empty string
  9651. Compile options: <none>
  9652. Overall options: anchored
  9653. Subject length lower bound = 0
  9654. /(^ab|^)++/I
  9655. Capture group count = 1
  9656. May match empty string
  9657. Compile options: <none>
  9658. Overall options: anchored
  9659. Subject length lower bound = 0
  9660. /(?:^ab)/I
  9661. Capture group count = 0
  9662. Compile options: <none>
  9663. Overall options: anchored
  9664. First code unit = 'a'
  9665. Subject length lower bound = 2
  9666. /(?:^ab)++/I
  9667. Capture group count = 0
  9668. Compile options: <none>
  9669. Overall options: anchored
  9670. First code unit = 'a'
  9671. Subject length lower bound = 2
  9672. /(?:^ab|^)+/I
  9673. Capture group count = 0
  9674. May match empty string
  9675. Compile options: <none>
  9676. Overall options: anchored
  9677. Subject length lower bound = 0
  9678. /(?:^ab|^)++/I
  9679. Capture group count = 0
  9680. May match empty string
  9681. Compile options: <none>
  9682. Overall options: anchored
  9683. Subject length lower bound = 0
  9684. /(.*ab)/I
  9685. Capture group count = 1
  9686. First code unit at start or follows newline
  9687. Last code unit = 'b'
  9688. Subject length lower bound = 2
  9689. /(.*ab)++/I
  9690. Capture group count = 1
  9691. First code unit at start or follows newline
  9692. Last code unit = 'b'
  9693. Subject length lower bound = 2
  9694. /(.*ab|.*)+/I
  9695. Capture group count = 1
  9696. May match empty string
  9697. First code unit at start or follows newline
  9698. Subject length lower bound = 0
  9699. /(.*ab|.*)++/I
  9700. Capture group count = 1
  9701. May match empty string
  9702. First code unit at start or follows newline
  9703. Subject length lower bound = 0
  9704. /(?:.*ab)/I
  9705. Capture group count = 0
  9706. First code unit at start or follows newline
  9707. Last code unit = 'b'
  9708. Subject length lower bound = 2
  9709. /(?:.*ab)++/I
  9710. Capture group count = 0
  9711. First code unit at start or follows newline
  9712. Last code unit = 'b'
  9713. Subject length lower bound = 2
  9714. /(?:.*ab|.*)+/I
  9715. Capture group count = 0
  9716. May match empty string
  9717. First code unit at start or follows newline
  9718. Subject length lower bound = 0
  9719. /(?:.*ab|.*)++/I
  9720. Capture group count = 0
  9721. May match empty string
  9722. First code unit at start or follows newline
  9723. Subject length lower bound = 0
  9724. /(?=a)[bcd]/I
  9725. Capture group count = 0
  9726. First code unit = 'a'
  9727. Subject length lower bound = 1
  9728. /((?=a))[bcd]/I
  9729. Capture group count = 1
  9730. First code unit = 'a'
  9731. Subject length lower bound = 1
  9732. /((?=a))+[bcd]/I
  9733. Capture group count = 1
  9734. First code unit = 'a'
  9735. Subject length lower bound = 1
  9736. /((?=a))++[bcd]/I
  9737. Capture group count = 1
  9738. First code unit = 'a'
  9739. Subject length lower bound = 1
  9740. /(?=a+)[bcd]/Ii
  9741. Capture group count = 0
  9742. Options: caseless
  9743. First code unit = 'a' (caseless)
  9744. Subject length lower bound = 1
  9745. /(?=a+?)[bcd]/Ii
  9746. Capture group count = 0
  9747. Options: caseless
  9748. First code unit = 'a' (caseless)
  9749. Subject length lower bound = 1
  9750. /(?=a++)[bcd]/Ii
  9751. Capture group count = 0
  9752. Options: caseless
  9753. First code unit = 'a' (caseless)
  9754. Subject length lower bound = 1
  9755. /(?=a{3})[bcd]/Ii
  9756. Capture group count = 0
  9757. Options: caseless
  9758. First code unit = 'a' (caseless)
  9759. Last code unit = 'a' (caseless)
  9760. Subject length lower bound = 2
  9761. /(abc)\1+/
  9762. # Perl doesn't get these right IMO (the 3rd is PCRE2-specific)
  9763. /(?1)(?:(b(*ACCEPT))){0}/
  9764. b
  9765. 0: b
  9766. /(?1)(?:(b(*ACCEPT))){0}c/
  9767. bc
  9768. 0: bc
  9769. \= Expect no match
  9770. b
  9771. No match
  9772. /(?1)(?:((*ACCEPT))){0}c/
  9773. c
  9774. 0: c
  9775. c\=notempty
  9776. 0: c
  9777. /^.*?(?(?=a)a|b(*THEN)c)/
  9778. \= Expect no match
  9779. ba
  9780. No match
  9781. /^.*?(?(?=a)a|bc)/
  9782. ba
  9783. 0: ba
  9784. /^.*?(?(?=a)a(*THEN)b|c)/
  9785. \= Expect no match
  9786. ac
  9787. No match
  9788. /^.*?(?(?=a)a(*THEN)b)c/
  9789. \= Expect no match
  9790. ac
  9791. No match
  9792. /^.*?(a(*THEN)b)c/
  9793. \= Expect no match
  9794. aabc
  9795. No match
  9796. /^.*? (?1) c (?(DEFINE)(a(*THEN)b))/x
  9797. aabc
  9798. 0: aabc
  9799. /^.*?(a(*THEN)b|z)c/
  9800. aabc
  9801. 0: aabc
  9802. 1: ab
  9803. /^.*?(z|a(*THEN)b)c/
  9804. aabc
  9805. 0: aabc
  9806. 1: ab
  9807. # These are here because they are not Perl-compatible; the studying means the
  9808. # mark is not seen.
  9809. /(*MARK:A)(*SKIP:B)(C|X)/mark
  9810. C
  9811. 0: C
  9812. 1: C
  9813. MK: A
  9814. \= Expect no match
  9815. D
  9816. No match, mark = A
  9817. /(*:A)A+(*SKIP:A)(B|Z)/mark
  9818. \= Expect no match
  9819. AAAC
  9820. No match, mark = A
  9821. # ----------------------------
  9822. "(?=a*(*ACCEPT)b)c"
  9823. c
  9824. 0: c
  9825. c\=notempty
  9826. 0: c
  9827. /(?1)c(?(DEFINE)((*ACCEPT)b))/
  9828. c
  9829. 0: c
  9830. c\=notempty
  9831. 0: c
  9832. /(?>(*ACCEPT)b)c/
  9833. c
  9834. 0:
  9835. \= Expect no match
  9836. c\=notempty
  9837. No match
  9838. /(?:(?>(a)))+a%/allaftertext
  9839. %aa%
  9840. 0: aa%
  9841. 0+
  9842. 1: a
  9843. 1+ a%
  9844. /(a)b|ac/allaftertext
  9845. ac\=ovector=1
  9846. 0: ac
  9847. 0+
  9848. /(a)(b)x|abc/allaftertext
  9849. abc\=ovector=2
  9850. 0: abc
  9851. 0+
  9852. /(a)bc|(a)(b)\2/
  9853. abc\=ovector=1
  9854. Matched, but too many substrings
  9855. 0: abc
  9856. abc\=ovector=2
  9857. 0: abc
  9858. 1: a
  9859. aba\=ovector=1
  9860. Matched, but too many substrings
  9861. 0: aba
  9862. aba\=ovector=2
  9863. Matched, but too many substrings
  9864. 0: aba
  9865. 1: <unset>
  9866. aba\=ovector=3
  9867. Matched, but too many substrings
  9868. 0: aba
  9869. 1: <unset>
  9870. 2: a
  9871. aba\=ovector=4
  9872. 0: aba
  9873. 1: <unset>
  9874. 2: a
  9875. 3: b
  9876. /(?(DEFINE)(a(?2)|b)(b(?1)|a))(?:(?1)|(?2))/I
  9877. Capture group count = 2
  9878. May match empty string
  9879. Subject length lower bound = 0
  9880. /(a(?2)|b)(b(?1)|a)(?:(?1)|(?2))/I
  9881. Capture group count = 2
  9882. Starting code units: a b
  9883. Subject length lower bound = 3
  9884. /(a(?2)|b)(b(?1)|a)(?1)(?2)/I
  9885. Capture group count = 2
  9886. Starting code units: a b
  9887. Subject length lower bound = 4
  9888. /(abc)(?1)/I
  9889. Capture group count = 1
  9890. First code unit = 'a'
  9891. Last code unit = 'c'
  9892. Subject length lower bound = 6
  9893. /(?:(foo)|(bar)|(baz))X/allcaptures
  9894. bazfooX
  9895. 0: fooX
  9896. 1: foo
  9897. 2: <unset>
  9898. 3: <unset>
  9899. foobazbarX
  9900. 0: barX
  9901. 1: <unset>
  9902. 2: bar
  9903. 3: <unset>
  9904. barfooX
  9905. 0: fooX
  9906. 1: foo
  9907. 2: <unset>
  9908. 3: <unset>
  9909. bazX
  9910. 0: bazX
  9911. 1: <unset>
  9912. 2: <unset>
  9913. 3: baz
  9914. foobarbazX
  9915. 0: bazX
  9916. 1: <unset>
  9917. 2: <unset>
  9918. 3: baz
  9919. bazfooX\=ovector=0
  9920. 0: fooX
  9921. 1: foo
  9922. 2: <unset>
  9923. 3: <unset>
  9924. bazfooX\=ovector=1
  9925. Matched, but too many substrings
  9926. 0: fooX
  9927. bazfooX\=ovector=2
  9928. 0: fooX
  9929. 1: foo
  9930. bazfooX\=ovector=3
  9931. 0: fooX
  9932. 1: foo
  9933. 2: <unset>
  9934. /(?=abc){3}abc/B
  9935. ------------------------------------------------------------------
  9936. Bra
  9937. Assert
  9938. abc
  9939. Ket
  9940. Assert
  9941. abc
  9942. Ket
  9943. Assert
  9944. abc
  9945. Ket
  9946. abc
  9947. Ket
  9948. End
  9949. ------------------------------------------------------------------
  9950. /(?=abc)+abc/B
  9951. ------------------------------------------------------------------
  9952. Bra
  9953. Assert
  9954. abc
  9955. Ket
  9956. Brazero
  9957. Assert
  9958. abc
  9959. Ket
  9960. abc
  9961. Ket
  9962. End
  9963. ------------------------------------------------------------------
  9964. /(?=abc)++abc/B
  9965. ------------------------------------------------------------------
  9966. Bra
  9967. Once
  9968. Assert
  9969. abc
  9970. Ket
  9971. Brazero
  9972. Assert
  9973. abc
  9974. Ket
  9975. Ket
  9976. abc
  9977. Ket
  9978. End
  9979. ------------------------------------------------------------------
  9980. /(?=abc){0}xyz/B
  9981. ------------------------------------------------------------------
  9982. Bra
  9983. Skip zero
  9984. Assert
  9985. abc
  9986. Ket
  9987. xyz
  9988. Ket
  9989. End
  9990. ------------------------------------------------------------------
  9991. /(?=(a))?./B
  9992. ------------------------------------------------------------------
  9993. Bra
  9994. Brazero
  9995. Assert
  9996. CBra 1
  9997. a
  9998. Ket
  9999. Ket
  10000. Any
  10001. Ket
  10002. End
  10003. ------------------------------------------------------------------
  10004. /(?=(a))??./B
  10005. ------------------------------------------------------------------
  10006. Bra
  10007. Braminzero
  10008. Assert
  10009. CBra 1
  10010. a
  10011. Ket
  10012. Ket
  10013. Any
  10014. Ket
  10015. End
  10016. ------------------------------------------------------------------
  10017. /^(?=(a)){0}b(?1)/B
  10018. ------------------------------------------------------------------
  10019. Bra
  10020. ^
  10021. Skip zero
  10022. Assert
  10023. CBra 1
  10024. a
  10025. Ket
  10026. Ket
  10027. b
  10028. Recurse
  10029. Ket
  10030. End
  10031. ------------------------------------------------------------------
  10032. /(?(DEFINE)(a))?b(?1)/B
  10033. ------------------------------------------------------------------
  10034. Bra
  10035. Cond
  10036. Cond false
  10037. CBra 1
  10038. a
  10039. Ket
  10040. Ket
  10041. b
  10042. Recurse
  10043. Ket
  10044. End
  10045. ------------------------------------------------------------------
  10046. /^(?=(?1))?[az]([abc])d/B
  10047. ------------------------------------------------------------------
  10048. Bra
  10049. ^
  10050. Brazero
  10051. Assert
  10052. Recurse
  10053. Ket
  10054. [az]
  10055. CBra 1
  10056. [a-c]
  10057. Ket
  10058. d
  10059. Ket
  10060. End
  10061. ------------------------------------------------------------------
  10062. /^(?!a){0}\w+/B
  10063. ------------------------------------------------------------------
  10064. Bra
  10065. ^
  10066. Skip zero
  10067. Assert not
  10068. a
  10069. Ket
  10070. \w++
  10071. Ket
  10072. End
  10073. ------------------------------------------------------------------
  10074. /(?<=(abc))?xyz/B
  10075. ------------------------------------------------------------------
  10076. Bra
  10077. Brazero
  10078. Assert back
  10079. Reverse
  10080. CBra 1
  10081. abc
  10082. Ket
  10083. Ket
  10084. xyz
  10085. Ket
  10086. End
  10087. ------------------------------------------------------------------
  10088. /[:a[:abc]b:]/B
  10089. ------------------------------------------------------------------
  10090. Bra
  10091. [:[a-c]
  10092. b:]
  10093. Ket
  10094. End
  10095. ------------------------------------------------------------------
  10096. /^(a(*:A)(d|e(*:B))z|aeq)/auto_callout
  10097. adz
  10098. --->adz
  10099. +0 ^ ^
  10100. +1 ^ (
  10101. +2 ^ a
  10102. +3 ^^ (*:A)
  10103. +8 ^^ (
  10104. Latest Mark: A
  10105. +9 ^^ d
  10106. +10 ^ ^ |
  10107. +18 ^ ^ z
  10108. +19 ^ ^ |
  10109. +24 ^ ^ End of pattern
  10110. 0: adz
  10111. 1: adz
  10112. 2: d
  10113. aez
  10114. --->aez
  10115. +0 ^ ^
  10116. +1 ^ (
  10117. +2 ^ a
  10118. +3 ^^ (*:A)
  10119. +8 ^^ (
  10120. Latest Mark: A
  10121. +9 ^^ d
  10122. +11 ^^ e
  10123. +12 ^ ^ (*:B)
  10124. +17 ^ ^ )
  10125. Latest Mark: B
  10126. +18 ^ ^ z
  10127. +19 ^ ^ |
  10128. +24 ^ ^ End of pattern
  10129. 0: aez
  10130. 1: aez
  10131. 2: e
  10132. aeqwerty
  10133. --->aeqwerty
  10134. +0 ^ ^
  10135. +1 ^ (
  10136. +2 ^ a
  10137. +3 ^^ (*:A)
  10138. +8 ^^ (
  10139. Latest Mark: A
  10140. +9 ^^ d
  10141. +11 ^^ e
  10142. +12 ^ ^ (*:B)
  10143. +17 ^ ^ )
  10144. Latest Mark: B
  10145. +18 ^ ^ z
  10146. +20 ^ a
  10147. +21 ^^ e
  10148. +22 ^ ^ q
  10149. +23 ^ ^ )
  10150. +24 ^ ^ End of pattern
  10151. 0: aeq
  10152. 1: aeq
  10153. /.(*F)/
  10154. \= Expect no match
  10155. abc\=ph
  10156. No match
  10157. /\btype\b\W*?\btext\b\W*?\bjavascript\b/I
  10158. Capture group count = 0
  10159. Max lookbehind = 1
  10160. First code unit = 't'
  10161. Last code unit = 't'
  10162. Subject length lower bound = 18
  10163. /\btype\b\W*?\btext\b\W*?\bjavascript\b|\burl\b\W*?\bshell:|<input\b.*?\btype\b\W*?\bimage\b|\bonkeyup\b\W*?\=/I
  10164. Capture group count = 0
  10165. Max lookbehind = 1
  10166. Starting code units: < o t u
  10167. Subject length lower bound = 8
  10168. /a(*SKIP)c|b(*ACCEPT)|/I,aftertext
  10169. Capture group count = 0
  10170. May match empty string
  10171. Subject length lower bound = 0
  10172. a
  10173. 0:
  10174. 0+
  10175. /a(*SKIP)c|b(*ACCEPT)cd(*ACCEPT)|x/I
  10176. Capture group count = 0
  10177. Starting code units: a b x
  10178. Subject length lower bound = 1
  10179. ax
  10180. 0: x
  10181. 'a*(*ACCEPT)b'aftertext
  10182. abc\=notempty_atstart
  10183. 0: a
  10184. 0+ bc
  10185. bbb\=notempty_atstart
  10186. 0:
  10187. 0+ bb
  10188. \= Expect no match
  10189. \=notempty_atstart
  10190. No match
  10191. /(*ACCEPT)a/I,aftertext
  10192. Capture group count = 0
  10193. May match empty string
  10194. Subject length lower bound = 0
  10195. bax
  10196. 0:
  10197. 0+ bax
  10198. /z(*ACCEPT)a/I,aftertext
  10199. Capture group count = 0
  10200. First code unit = 'z'
  10201. Subject length lower bound = 1
  10202. baxzbx
  10203. 0: z
  10204. 0+ bx
  10205. /^(?>a+)(?>(z+))\w/B
  10206. ------------------------------------------------------------------
  10207. Bra
  10208. ^
  10209. Once
  10210. a++
  10211. Ket
  10212. Once
  10213. CBra 1
  10214. z++
  10215. Ket
  10216. Ket
  10217. \w
  10218. Ket
  10219. End
  10220. ------------------------------------------------------------------
  10221. aaaazzzzb
  10222. 0: aaaazzzzb
  10223. 1: zzzz
  10224. \= Expect no match
  10225. aazz
  10226. No match
  10227. /(.)(\1|a(?2))/
  10228. bab
  10229. 0: bab
  10230. 1: b
  10231. 2: ab
  10232. /\1|(.)(?R)\1/
  10233. cbbbc
  10234. 0: cbbbc
  10235. 1: c
  10236. /(.)((?(1)c|a)|a(?2))/
  10237. \= Expect no match
  10238. baa
  10239. No match
  10240. /(?P<abn>(?P=abn)xxx)/B
  10241. ------------------------------------------------------------------
  10242. Bra
  10243. CBra 1
  10244. \1
  10245. xxx
  10246. Ket
  10247. Ket
  10248. End
  10249. ------------------------------------------------------------------
  10250. /(a\1z)/B
  10251. ------------------------------------------------------------------
  10252. Bra
  10253. CBra 1
  10254. a
  10255. \1
  10256. z
  10257. Ket
  10258. Ket
  10259. End
  10260. ------------------------------------------------------------------
  10261. /^a\x41z/alt_bsux,allow_empty_class,match_unset_backref,dupnames
  10262. aAz
  10263. 0: aAz
  10264. \= Expect no match
  10265. ax41z
  10266. No match
  10267. /^a[m\x41]z/alt_bsux,allow_empty_class,match_unset_backref,dupnames
  10268. aAz
  10269. 0: aAz
  10270. /^a\x1z/alt_bsux,allow_empty_class,match_unset_backref,dupnames
  10271. ax1z
  10272. 0: ax1z
  10273. /^a\u0041z/alt_bsux,allow_empty_class,match_unset_backref,dupnames
  10274. aAz
  10275. 0: aAz
  10276. \= Expect no match
  10277. au0041z
  10278. No match
  10279. /^a[m\u0041]z/alt_bsux,allow_empty_class,match_unset_backref,dupnames
  10280. aAz
  10281. 0: aAz
  10282. /^a\u041z/alt_bsux,allow_empty_class,match_unset_backref,dupnames
  10283. au041z
  10284. 0: au041z
  10285. \= Expect no match
  10286. aAz
  10287. No match
  10288. /^a\U0041z/alt_bsux,allow_empty_class,match_unset_backref,dupnames
  10289. aU0041z
  10290. 0: aU0041z
  10291. \= Expect no match
  10292. aAz
  10293. No match
  10294. /^\u{7a}/alt_bsux
  10295. u{7a}
  10296. 0: u{7a}
  10297. \= Expect no match
  10298. zoo
  10299. No match
  10300. /^\u{7a}/extra_alt_bsux
  10301. zoo
  10302. 0: z
  10303. /(?(?=c)c|d)++Y/B
  10304. ------------------------------------------------------------------
  10305. Bra
  10306. BraPos
  10307. Cond
  10308. Assert
  10309. c
  10310. Ket
  10311. c
  10312. Alt
  10313. d
  10314. Ket
  10315. KetRpos
  10316. Y
  10317. Ket
  10318. End
  10319. ------------------------------------------------------------------
  10320. /(?(?=c)c|d)*+Y/B
  10321. ------------------------------------------------------------------
  10322. Bra
  10323. Braposzero
  10324. BraPos
  10325. Cond
  10326. Assert
  10327. c
  10328. Ket
  10329. c
  10330. Alt
  10331. d
  10332. Ket
  10333. KetRpos
  10334. Y
  10335. Ket
  10336. End
  10337. ------------------------------------------------------------------
  10338. /a[\NB]c/
  10339. Failed: error 171 at offset 4: \N is not supported in a class
  10340. aNc
  10341. /a[B-\Nc]/
  10342. Failed: error 150 at offset 6: invalid range in character class
  10343. /a[B\Nc]/
  10344. Failed: error 171 at offset 5: \N is not supported in a class
  10345. /(a)(?2){0,1999}?(b)/
  10346. /(a)(?(DEFINE)(b))(?2){0,1999}?(?2)/
  10347. # This test, with something more complicated than individual letters, causes
  10348. # different behaviour in Perl. Perhaps it disables some optimization; no tag is
  10349. # passed back for the failures, whereas in PCRE2 there is a tag.
  10350. /(A|P)(*:A)(B|P) | (X|P)(X|P)(*:B)(Y|P)/x,mark
  10351. AABC
  10352. 0: AB
  10353. 1: A
  10354. 2: B
  10355. MK: A
  10356. XXYZ
  10357. 0: XXY
  10358. 1: <unset>
  10359. 2: <unset>
  10360. 3: X
  10361. 4: X
  10362. 5: Y
  10363. MK: B
  10364. \= Expect no match
  10365. XAQQ
  10366. No match, mark = A
  10367. XAQQXZZ
  10368. No match, mark = A
  10369. AXQQQ
  10370. No match, mark = A
  10371. AXXQQQ
  10372. No match, mark = B
  10373. # Perl doesn't give marks for these, though it does if the alternatives are
  10374. # replaced by single letters.
  10375. /(b|q)(*:m)f|a(*:n)w/mark
  10376. aw
  10377. 0: aw
  10378. MK: n
  10379. \= Expect no match
  10380. abc
  10381. No match, mark = m
  10382. /(q|b)(*:m)f|a(*:n)w/mark
  10383. aw
  10384. 0: aw
  10385. MK: n
  10386. \= Expect no match
  10387. abc
  10388. No match, mark = m
  10389. # After a partial match, the behaviour is as for a failure.
  10390. /^a(*:X)bcde/mark
  10391. abc\=ps
  10392. Partial match, mark=X: abc
  10393. # These are here because Perl doesn't return a mark, except for the first.
  10394. /(?=(*:x))(q|)/aftertext,mark
  10395. abc
  10396. 0:
  10397. 0+ abc
  10398. 1:
  10399. MK: x
  10400. /(?=(*:x))((*:y)q|)/aftertext,mark
  10401. abc
  10402. 0:
  10403. 0+ abc
  10404. 1:
  10405. MK: x
  10406. /(?=(*:x))(?:(*:y)q|)/aftertext,mark
  10407. abc
  10408. 0:
  10409. 0+ abc
  10410. MK: x
  10411. /(?=(*:x))(?>(*:y)q|)/aftertext,mark
  10412. abc
  10413. 0:
  10414. 0+ abc
  10415. MK: x
  10416. /(?=a(*:x))(?!a(*:y)c)/aftertext,mark
  10417. ab
  10418. 0:
  10419. 0+ ab
  10420. MK: x
  10421. /(?=a(*:x))(?=a(*:y)c|)/aftertext,mark
  10422. ab
  10423. 0:
  10424. 0+ ab
  10425. MK: x
  10426. /(..)\1/
  10427. ab\=ps
  10428. Partial match: ab
  10429. aba\=ps
  10430. Partial match: aba
  10431. abab\=ps
  10432. 0: abab
  10433. 1: ab
  10434. /(..)\1/i
  10435. ab\=ps
  10436. Partial match: ab
  10437. abA\=ps
  10438. Partial match: abA
  10439. aBAb\=ps
  10440. 0: aBAb
  10441. 1: aB
  10442. /(..)\1{2,}/
  10443. ab\=ps
  10444. Partial match: ab
  10445. aba\=ps
  10446. Partial match: aba
  10447. abab\=ps
  10448. Partial match: abab
  10449. ababa\=ps
  10450. Partial match: ababa
  10451. ababab\=ps
  10452. 0: ababab
  10453. 1: ab
  10454. ababab\=ph
  10455. Partial match: ababab
  10456. abababa\=ps
  10457. 0: ababab
  10458. 1: ab
  10459. abababa\=ph
  10460. Partial match: abababa
  10461. /(..)\1{2,}/i
  10462. ab\=ps
  10463. Partial match: ab
  10464. aBa\=ps
  10465. Partial match: aBa
  10466. aBAb\=ps
  10467. Partial match: aBAb
  10468. AbaBA\=ps
  10469. Partial match: AbaBA
  10470. abABAb\=ps
  10471. 0: abABAb
  10472. 1: ab
  10473. aBAbaB\=ph
  10474. Partial match: aBAbaB
  10475. abABabA\=ps
  10476. 0: abABab
  10477. 1: ab
  10478. abaBABa\=ph
  10479. Partial match: abaBABa
  10480. /(..)\1{2,}?x/i
  10481. ab\=ps
  10482. Partial match: ab
  10483. abA\=ps
  10484. Partial match: abA
  10485. aBAb\=ps
  10486. Partial match: aBAb
  10487. abaBA\=ps
  10488. Partial match: abaBA
  10489. abAbaB\=ps
  10490. Partial match: abAbaB
  10491. abaBabA\=ps
  10492. Partial match: abaBabA
  10493. abAbABaBx\=ps
  10494. 0: abAbABaBx
  10495. 1: ab
  10496. /^(..)\1/
  10497. aba\=ps
  10498. Partial match: aba
  10499. /^(..)\1{2,3}x/
  10500. aba\=ps
  10501. Partial match: aba
  10502. ababa\=ps
  10503. Partial match: ababa
  10504. ababa\=ph
  10505. Partial match: ababa
  10506. abababx
  10507. 0: abababx
  10508. 1: ab
  10509. ababababx
  10510. 0: ababababx
  10511. 1: ab
  10512. /^(..)\1{2,3}?x/
  10513. aba\=ps
  10514. Partial match: aba
  10515. ababa\=ps
  10516. Partial match: ababa
  10517. ababa\=ph
  10518. Partial match: ababa
  10519. abababx
  10520. 0: abababx
  10521. 1: ab
  10522. ababababx
  10523. 0: ababababx
  10524. 1: ab
  10525. /^(..)(\1{2,3})ab/
  10526. abababab
  10527. 0: abababab
  10528. 1: ab
  10529. 2: abab
  10530. /^\R/
  10531. \r\=ps
  10532. 0: \x0d
  10533. \r\=ph
  10534. Partial match: \x0d
  10535. /^\R{2,3}x/
  10536. \r\=ps
  10537. Partial match: \x0d
  10538. \r\=ph
  10539. Partial match: \x0d
  10540. \r\r\=ps
  10541. Partial match: \x0d\x0d
  10542. \r\r\=ph
  10543. Partial match: \x0d\x0d
  10544. \r\r\r\=ps
  10545. Partial match: \x0d\x0d\x0d
  10546. \r\r\r\=ph
  10547. Partial match: \x0d\x0d\x0d
  10548. \r\rx
  10549. 0: \x0d\x0dx
  10550. \r\r\rx
  10551. 0: \x0d\x0d\x0dx
  10552. /^\R{2,3}?x/
  10553. \r\=ps
  10554. Partial match: \x0d
  10555. \r\=ph
  10556. Partial match: \x0d
  10557. \r\r\=ps
  10558. Partial match: \x0d\x0d
  10559. \r\r\=ph
  10560. Partial match: \x0d\x0d
  10561. \r\r\r\=ps
  10562. Partial match: \x0d\x0d\x0d
  10563. \r\r\r\=ph
  10564. Partial match: \x0d\x0d\x0d
  10565. \r\rx
  10566. 0: \x0d\x0dx
  10567. \r\r\rx
  10568. 0: \x0d\x0d\x0dx
  10569. /^\R?x/
  10570. \r\=ps
  10571. Partial match: \x0d
  10572. \r\=ph
  10573. Partial match: \x0d
  10574. x
  10575. 0: x
  10576. \rx
  10577. 0: \x0dx
  10578. /^\R+x/
  10579. \r\=ps
  10580. Partial match: \x0d
  10581. \r\=ph
  10582. Partial match: \x0d
  10583. \r\n\=ps
  10584. Partial match: \x0d\x0a
  10585. \r\n\=ph
  10586. Partial match: \x0d\x0a
  10587. \rx
  10588. 0: \x0dx
  10589. /^a$/newline=crlf
  10590. a\r\=ps
  10591. Partial match: a\x0d
  10592. a\r\=ph
  10593. Partial match: a\x0d
  10594. /^a$/m,newline=crlf
  10595. a\r\=ps
  10596. Partial match: a\x0d
  10597. a\r\=ph
  10598. Partial match: a\x0d
  10599. /^(a$|a\r)/newline=crlf
  10600. a\r\=ps
  10601. 0: a\x0d
  10602. 1: a\x0d
  10603. a\r\=ph
  10604. Partial match: a\x0d
  10605. /^(a$|a\r)/m,newline=crlf
  10606. a\r\=ps
  10607. 0: a\x0d
  10608. 1: a\x0d
  10609. a\r\=ph
  10610. Partial match: a\x0d
  10611. /./newline=crlf
  10612. \r\=ps
  10613. 0: \x0d
  10614. \r\=ph
  10615. Partial match: \x0d
  10616. /.{2,3}/newline=crlf
  10617. \r\=ps
  10618. Partial match: \x0d
  10619. \r\=ph
  10620. Partial match: \x0d
  10621. \r\r\=ps
  10622. 0: \x0d\x0d
  10623. \r\r\=ph
  10624. Partial match: \x0d\x0d
  10625. \r\r\r\=ps
  10626. 0: \x0d\x0d\x0d
  10627. \r\r\r\=ph
  10628. Partial match: \x0d\x0d\x0d
  10629. /.{2,3}?/newline=crlf
  10630. \r\=ps
  10631. Partial match: \x0d
  10632. \r\=ph
  10633. Partial match: \x0d
  10634. \r\r\=ps
  10635. 0: \x0d\x0d
  10636. \r\r\=ph
  10637. Partial match: \x0d\x0d
  10638. \r\r\r\=ps
  10639. 0: \x0d\x0d
  10640. \r\r\r\=ph
  10641. 0: \x0d\x0d
  10642. "AB(C(D))(E(F))?(?(?=\2)(?=\4))"
  10643. ABCDGHI\=ovector=01
  10644. Matched, but too many substrings
  10645. 0: ABCD
  10646. # These are all run as real matches in test 1; here we are just checking the
  10647. # settings of the anchored and startline bits.
  10648. /(?>.*?a)(?<=ba)/I
  10649. Capture group count = 0
  10650. Max lookbehind = 2
  10651. Last code unit = 'a'
  10652. Subject length lower bound = 1
  10653. /(?:.*?a)(?<=ba)/I
  10654. Capture group count = 0
  10655. Max lookbehind = 2
  10656. First code unit at start or follows newline
  10657. Last code unit = 'a'
  10658. Subject length lower bound = 1
  10659. /.*?a(*PRUNE)b/I
  10660. Capture group count = 0
  10661. Last code unit = 'b'
  10662. Subject length lower bound = 2
  10663. /.*?a(*PRUNE)b/Is
  10664. Capture group count = 0
  10665. Options: dotall
  10666. Last code unit = 'b'
  10667. Subject length lower bound = 2
  10668. /^a(*PRUNE)b/Is
  10669. Capture group count = 0
  10670. Compile options: dotall
  10671. Overall options: anchored dotall
  10672. First code unit = 'a'
  10673. Subject length lower bound = 2
  10674. /.*?a(*SKIP)b/I
  10675. Capture group count = 0
  10676. Last code unit = 'b'
  10677. Subject length lower bound = 2
  10678. /(?>.*?a)b/Is
  10679. Capture group count = 0
  10680. Options: dotall
  10681. Last code unit = 'b'
  10682. Subject length lower bound = 2
  10683. /(?>.*?a)b/I
  10684. Capture group count = 0
  10685. Last code unit = 'b'
  10686. Subject length lower bound = 2
  10687. /(?>^a)b/Is
  10688. Capture group count = 0
  10689. Compile options: dotall
  10690. Overall options: anchored dotall
  10691. First code unit = 'a'
  10692. Subject length lower bound = 2
  10693. /(?>.*?)(?<=(abcd)|(wxyz))/I
  10694. Capture group count = 2
  10695. Max lookbehind = 4
  10696. May match empty string
  10697. Subject length lower bound = 0
  10698. /(?>.*)(?<=(abcd)|(wxyz))/I
  10699. Capture group count = 2
  10700. Max lookbehind = 4
  10701. May match empty string
  10702. Subject length lower bound = 0
  10703. "(?>.*)foo"I
  10704. Capture group count = 0
  10705. Last code unit = 'o'
  10706. Subject length lower bound = 3
  10707. "(?>.*?)foo"I
  10708. Capture group count = 0
  10709. Last code unit = 'o'
  10710. Subject length lower bound = 3
  10711. /(?>^abc)/Im
  10712. Capture group count = 0
  10713. Options: multiline
  10714. First code unit at start or follows newline
  10715. Last code unit = 'c'
  10716. Subject length lower bound = 3
  10717. /(?>.*abc)/Im
  10718. Capture group count = 0
  10719. Options: multiline
  10720. Last code unit = 'c'
  10721. Subject length lower bound = 3
  10722. /(?:.*abc)/Im
  10723. Capture group count = 0
  10724. Options: multiline
  10725. First code unit at start or follows newline
  10726. Last code unit = 'c'
  10727. Subject length lower bound = 3
  10728. /(?:(a)+(?C1)bb|aa(?C2)b)/
  10729. aab\=callout_capture
  10730. Callout 1: last capture = 1
  10731. 1: a
  10732. --->aab
  10733. ^ ^ b
  10734. Callout 1: last capture = 1
  10735. 1: a
  10736. --->aab
  10737. ^^ b
  10738. Callout 2: last capture = 0
  10739. --->aab
  10740. ^ ^ b
  10741. 0: aab
  10742. /(?:(a)++(?C1)bb|aa(?C2)b)/
  10743. aab\=callout_capture
  10744. Callout 1: last capture = 1
  10745. 1: a
  10746. --->aab
  10747. ^ ^ b
  10748. Callout 2: last capture = 0
  10749. --->aab
  10750. ^ ^ b
  10751. 0: aab
  10752. /(?:(?>(a))(?C1)bb|aa(?C2)b)/
  10753. aab\=callout_capture
  10754. Callout 1: last capture = 1
  10755. 1: a
  10756. --->aab
  10757. ^^ b
  10758. Callout 2: last capture = 0
  10759. --->aab
  10760. ^ ^ b
  10761. 0: aab
  10762. /(?:(?1)(?C1)x|ab(?C2))((a)){0}/
  10763. aab\=callout_capture
  10764. Callout 1: last capture = 0
  10765. --->aab
  10766. ^^ x
  10767. Callout 1: last capture = 0
  10768. --->aab
  10769. ^^ x
  10770. Callout 2: last capture = 0
  10771. --->aab
  10772. ^ ^ )
  10773. 0: ab
  10774. /(?1)(?C1)((a)(?C2)){0}/
  10775. aab\=callout_capture
  10776. Callout 2: last capture = 2
  10777. 1: <unset>
  10778. 2: a
  10779. --->aab
  10780. ^^ ){0}
  10781. Callout 1: last capture = 0
  10782. --->aab
  10783. ^^ (
  10784. 0: a
  10785. /(?:(a)+(?C1)bb|aa(?C2)b)++/
  10786. aab\=callout_capture
  10787. Callout 1: last capture = 1
  10788. 1: a
  10789. --->aab
  10790. ^ ^ b
  10791. Callout 1: last capture = 1
  10792. 1: a
  10793. --->aab
  10794. ^^ b
  10795. Callout 2: last capture = 0
  10796. --->aab
  10797. ^ ^ b
  10798. 0: aab
  10799. aab\=callout_capture,ovector=1
  10800. Callout 1: last capture = 1
  10801. 1: a
  10802. --->aab
  10803. ^ ^ b
  10804. Callout 1: last capture = 1
  10805. 1: a
  10806. --->aab
  10807. ^^ b
  10808. Callout 2: last capture = 0
  10809. --->aab
  10810. ^ ^ b
  10811. 0: aab
  10812. /(ab)x|ab/
  10813. ab\=ovector=0
  10814. 0: ab
  10815. ab\=ovector=1
  10816. 0: ab
  10817. /(?<=123)(*MARK:xx)abc/mark
  10818. xxxx123a\=ph
  10819. Partial match, mark=xx: a
  10820. xxxx123a\=ps
  10821. Partial match, mark=xx: a
  10822. /123\Kabc/startchar
  10823. xxxx123a\=ph
  10824. Partial match: 123a
  10825. xxxx123a\=ps
  10826. Partial match: 123a
  10827. /^(?(?=a)aa|bb)/auto_callout
  10828. bb
  10829. --->bb
  10830. +0 ^ ^
  10831. +1 ^ (?
  10832. +3 ^ (?=
  10833. +6 ^ a
  10834. +11 ^ b
  10835. +12 ^^ b
  10836. +13 ^ ^ )
  10837. +14 ^ ^ End of pattern
  10838. 0: bb
  10839. /(?C1)^(?C2)(?(?C99)(?=(?C3)a(?C4))(?C5)a(?C6)a(?C7)|(?C8)b(?C9)b(?C10))(?C11)/
  10840. bb
  10841. --->bb
  10842. 1 ^ ^
  10843. 2 ^ (?
  10844. 99 ^ (?=
  10845. 3 ^ a
  10846. 8 ^ b
  10847. 9 ^^ b
  10848. 10 ^ ^ )
  10849. 11 ^ ^ End of pattern
  10850. 0: bb
  10851. # Perl seems to have a bug with this one.
  10852. /aaaaa(*COMMIT)(*PRUNE)b|a+c/
  10853. aaaaaac
  10854. 0: aaaac
  10855. # Here are some that Perl treats differently because of the way it handles
  10856. # backtracking verbs.
  10857. /(?!a(*COMMIT)b)ac|ad/
  10858. ac
  10859. 0: ac
  10860. ad
  10861. 0: ad
  10862. /^(?!a(*THEN)b|ac)../
  10863. ad
  10864. 0: ad
  10865. \= Expect no match
  10866. ac
  10867. No match
  10868. /^(?=a(*THEN)b|ac)/
  10869. ac
  10870. 0:
  10871. /\A.*?(?:a|b(*THEN)c)/
  10872. ba
  10873. 0: ba
  10874. /\A.*?(?:a|b(*THEN)c)++/
  10875. ba
  10876. 0: ba
  10877. /\A.*?(?:a|b(*THEN)c|d)/
  10878. ba
  10879. 0: ba
  10880. /(?:(a(*MARK:X)a+(*SKIP:X)b)){0}(?:(?1)|aac)/
  10881. aac
  10882. 0: aac
  10883. /\A.*?(a|b(*THEN)c)/
  10884. ba
  10885. 0: ba
  10886. 1: a
  10887. /^(A(*THEN)B|A(*THEN)D)/
  10888. AD
  10889. 0: AD
  10890. 1: AD
  10891. /(?!b(*THEN)a)bn|bnn/
  10892. bnn
  10893. 0: bn
  10894. /(?(?=b(*SKIP)a)bn|bnn)/
  10895. bnn
  10896. 0: bnn
  10897. /(?=b(*THEN)a|)bn|bnn/
  10898. bnn
  10899. 0: bn
  10900. # This test causes a segfault with Perl 5.18.0
  10901. /^(?=(a)){0}b(?1)/
  10902. backgammon
  10903. 0: ba
  10904. /(?|(?<n>f)|(?<n>b))/I,dupnames
  10905. Capture group count = 1
  10906. Named capture groups:
  10907. n 1
  10908. Options: dupnames
  10909. Starting code units: b f
  10910. Subject length lower bound = 1
  10911. /(?<a>abc)(?<a>z)\k<a>()/IB,dupnames
  10912. ------------------------------------------------------------------
  10913. Bra
  10914. CBra 1
  10915. abc
  10916. Ket
  10917. CBra 2
  10918. z
  10919. Ket
  10920. \k<a>2
  10921. CBra 3
  10922. Ket
  10923. Ket
  10924. End
  10925. ------------------------------------------------------------------
  10926. Capture group count = 3
  10927. Max back reference = 2
  10928. Named capture groups:
  10929. a 1
  10930. a 2
  10931. Options: dupnames
  10932. First code unit = 'a'
  10933. Last code unit = 'z'
  10934. Subject length lower bound = 5
  10935. /a*[bcd]/B
  10936. ------------------------------------------------------------------
  10937. Bra
  10938. a*+
  10939. [b-d]
  10940. Ket
  10941. End
  10942. ------------------------------------------------------------------
  10943. /[bcd]*a/B
  10944. ------------------------------------------------------------------
  10945. Bra
  10946. [b-d]*+
  10947. a
  10948. Ket
  10949. End
  10950. ------------------------------------------------------------------
  10951. # A complete set of tests for auto-possessification of character types, but
  10952. # omitting \C because it might be disabled (it has its own tests).
  10953. /\D+\D \D+\d \D+\S \D+\s \D+\W \D+\w \D+. \D+\R \D+\H \D+\h \D+\V \D+\v \D+\Z \D+\z \D+$/Bx
  10954. ------------------------------------------------------------------
  10955. Bra
  10956. \D+
  10957. \D
  10958. \D++
  10959. \d
  10960. \D+
  10961. \S
  10962. \D+
  10963. \s
  10964. \D+
  10965. \W
  10966. \D+
  10967. \w
  10968. \D+
  10969. Any
  10970. \D+
  10971. \R
  10972. \D+
  10973. \H
  10974. \D+
  10975. \h
  10976. \D+
  10977. \V
  10978. \D+
  10979. \v
  10980. \D+
  10981. \Z
  10982. \D++
  10983. \z
  10984. \D+
  10985. $
  10986. Ket
  10987. End
  10988. ------------------------------------------------------------------
  10989. /\d+\D \d+\d \d+\S \d+\s \d+\W \d+\w \d+. \d+\R \d+\H \d+\h \d+\V \d+\v \d+\Z \d+\z \d+$/Bx
  10990. ------------------------------------------------------------------
  10991. Bra
  10992. \d++
  10993. \D
  10994. \d+
  10995. \d
  10996. \d+
  10997. \S
  10998. \d++
  10999. \s
  11000. \d++
  11001. \W
  11002. \d+
  11003. \w
  11004. \d+
  11005. Any
  11006. \d++
  11007. \R
  11008. \d+
  11009. \H
  11010. \d++
  11011. \h
  11012. \d+
  11013. \V
  11014. \d++
  11015. \v
  11016. \d++
  11017. \Z
  11018. \d++
  11019. \z
  11020. \d++
  11021. $
  11022. Ket
  11023. End
  11024. ------------------------------------------------------------------
  11025. /\S+\D \S+\d \S+\S \S+\s \S+\W \S+\w \S+. \S+\R \S+\H \S+\h \S+\V \S+\v \S+\Z \S+\z \S+$/Bx
  11026. ------------------------------------------------------------------
  11027. Bra
  11028. \S+
  11029. \D
  11030. \S+
  11031. \d
  11032. \S+
  11033. \S
  11034. \S++
  11035. \s
  11036. \S+
  11037. \W
  11038. \S+
  11039. \w
  11040. \S+
  11041. Any
  11042. \S++
  11043. \R
  11044. \S+
  11045. \H
  11046. \S++
  11047. \h
  11048. \S+
  11049. \V
  11050. \S++
  11051. \v
  11052. \S++
  11053. \Z
  11054. \S++
  11055. \z
  11056. \S++
  11057. $
  11058. Ket
  11059. End
  11060. ------------------------------------------------------------------
  11061. /\s+\D \s+\d \s+\S \s+\s \s+\W \s+\w \s+. \s+\R \s+\H \s+\h \s+\V \s+\v \s+\Z \s+\z \s+$/Bx
  11062. ------------------------------------------------------------------
  11063. Bra
  11064. \s+
  11065. \D
  11066. \s++
  11067. \d
  11068. \s++
  11069. \S
  11070. \s+
  11071. \s
  11072. \s+
  11073. \W
  11074. \s++
  11075. \w
  11076. \s+
  11077. Any
  11078. \s+
  11079. \R
  11080. \s+
  11081. \H
  11082. \s+
  11083. \h
  11084. \s+
  11085. \V
  11086. \s+
  11087. \v
  11088. \s+
  11089. \Z
  11090. \s++
  11091. \z
  11092. \s+
  11093. $
  11094. Ket
  11095. End
  11096. ------------------------------------------------------------------
  11097. /\W+\D \W+\d \W+\S \W+\s \W+\W \W+\w \W+. \W+\R \W+\H \W+\h \W+\V \W+\v \W+\Z \W+\z \W+$/Bx
  11098. ------------------------------------------------------------------
  11099. Bra
  11100. \W+
  11101. \D
  11102. \W++
  11103. \d
  11104. \W+
  11105. \S
  11106. \W+
  11107. \s
  11108. \W+
  11109. \W
  11110. \W++
  11111. \w
  11112. \W+
  11113. Any
  11114. \W+
  11115. \R
  11116. \W+
  11117. \H
  11118. \W+
  11119. \h
  11120. \W+
  11121. \V
  11122. \W+
  11123. \v
  11124. \W+
  11125. \Z
  11126. \W++
  11127. \z
  11128. \W+
  11129. $
  11130. Ket
  11131. End
  11132. ------------------------------------------------------------------
  11133. /\w+\D \w+\d \w+\S \w+\s \w+\W \w+\w \w+. \w+\R \w+\H \w+\h \w+\V \w+\v \w+\Z \w+\z \w+$/Bx
  11134. ------------------------------------------------------------------
  11135. Bra
  11136. \w+
  11137. \D
  11138. \w+
  11139. \d
  11140. \w+
  11141. \S
  11142. \w++
  11143. \s
  11144. \w++
  11145. \W
  11146. \w+
  11147. \w
  11148. \w+
  11149. Any
  11150. \w++
  11151. \R
  11152. \w+
  11153. \H
  11154. \w++
  11155. \h
  11156. \w+
  11157. \V
  11158. \w++
  11159. \v
  11160. \w++
  11161. \Z
  11162. \w++
  11163. \z
  11164. \w++
  11165. $
  11166. Ket
  11167. End
  11168. ------------------------------------------------------------------
  11169. /\R+\D \R+\d \R+\S \R+\s \R+\W \R+\w \R+. \R+\R \R+\H \R+\h \R+\V \R+\v \R+\Z \R+\z \R+$/Bx
  11170. ------------------------------------------------------------------
  11171. Bra
  11172. \R+
  11173. \D
  11174. \R++
  11175. \d
  11176. \R+
  11177. \S
  11178. \R++
  11179. \s
  11180. \R+
  11181. \W
  11182. \R++
  11183. \w
  11184. \R++
  11185. Any
  11186. \R+
  11187. \R
  11188. \R+
  11189. \H
  11190. \R++
  11191. \h
  11192. \R+
  11193. \V
  11194. \R+
  11195. \v
  11196. \R+
  11197. \Z
  11198. \R++
  11199. \z
  11200. \R+
  11201. $
  11202. Ket
  11203. End
  11204. ------------------------------------------------------------------
  11205. /\H+\D \H+\d \H+\S \H+\s \H+\W \H+\w \H+. \H+\R \H+\H \H+\h \H+\V \H+\v \H+\Z \H+\z \H+$/Bx
  11206. ------------------------------------------------------------------
  11207. Bra
  11208. \H+
  11209. \D
  11210. \H+
  11211. \d
  11212. \H+
  11213. \S
  11214. \H+
  11215. \s
  11216. \H+
  11217. \W
  11218. \H+
  11219. \w
  11220. \H+
  11221. Any
  11222. \H+
  11223. \R
  11224. \H+
  11225. \H
  11226. \H++
  11227. \h
  11228. \H+
  11229. \V
  11230. \H+
  11231. \v
  11232. \H+
  11233. \Z
  11234. \H++
  11235. \z
  11236. \H+
  11237. $
  11238. Ket
  11239. End
  11240. ------------------------------------------------------------------
  11241. /\h+\D \h+\d \h+\S \h+\s \h+\W \h+\w \h+. \h+\R \h+\H \h+\h \h+\V \h+\v \h+\Z \h+\z \h+$/Bx
  11242. ------------------------------------------------------------------
  11243. Bra
  11244. \h+
  11245. \D
  11246. \h++
  11247. \d
  11248. \h++
  11249. \S
  11250. \h+
  11251. \s
  11252. \h+
  11253. \W
  11254. \h++
  11255. \w
  11256. \h+
  11257. Any
  11258. \h++
  11259. \R
  11260. \h++
  11261. \H
  11262. \h+
  11263. \h
  11264. \h+
  11265. \V
  11266. \h++
  11267. \v
  11268. \h+
  11269. \Z
  11270. \h++
  11271. \z
  11272. \h+
  11273. $
  11274. Ket
  11275. End
  11276. ------------------------------------------------------------------
  11277. /\V+\D \V+\d \V+\S \V+\s \V+\W \V+\w \V+. \V+\R \V+\H \V+\h \V+\V \V+\v \V+\Z \V+\z \V+$/Bx
  11278. ------------------------------------------------------------------
  11279. Bra
  11280. \V+
  11281. \D
  11282. \V+
  11283. \d
  11284. \V+
  11285. \S
  11286. \V+
  11287. \s
  11288. \V+
  11289. \W
  11290. \V+
  11291. \w
  11292. \V+
  11293. Any
  11294. \V++
  11295. \R
  11296. \V+
  11297. \H
  11298. \V+
  11299. \h
  11300. \V+
  11301. \V
  11302. \V++
  11303. \v
  11304. \V+
  11305. \Z
  11306. \V++
  11307. \z
  11308. \V+
  11309. $
  11310. Ket
  11311. End
  11312. ------------------------------------------------------------------
  11313. /\v+\D \v+\d \v+\S \v+\s \v+\W \v+\w \v+. \v+\R \v+\H \v+\h \v+\V \v+\v \v+\Z \v+\z \v+$/Bx
  11314. ------------------------------------------------------------------
  11315. Bra
  11316. \v+
  11317. \D
  11318. \v++
  11319. \d
  11320. \v++
  11321. \S
  11322. \v+
  11323. \s
  11324. \v+
  11325. \W
  11326. \v++
  11327. \w
  11328. \v+
  11329. Any
  11330. \v+
  11331. \R
  11332. \v+
  11333. \H
  11334. \v++
  11335. \h
  11336. \v++
  11337. \V
  11338. \v+
  11339. \v
  11340. \v+
  11341. \Z
  11342. \v++
  11343. \z
  11344. \v+
  11345. $
  11346. Ket
  11347. End
  11348. ------------------------------------------------------------------
  11349. / a+\D a+\d a+\S a+\s a+\W a+\w a+. a+\R a+\H a+\h a+\V a+\v a+\Z a+\z a+$/Bx
  11350. ------------------------------------------------------------------
  11351. Bra
  11352. a+
  11353. \D
  11354. a++
  11355. \d
  11356. a+
  11357. \S
  11358. a++
  11359. \s
  11360. a++
  11361. \W
  11362. a+
  11363. \w
  11364. a+
  11365. Any
  11366. a++
  11367. \R
  11368. a+
  11369. \H
  11370. a++
  11371. \h
  11372. a+
  11373. \V
  11374. a++
  11375. \v
  11376. a++
  11377. \Z
  11378. a++
  11379. \z
  11380. a++
  11381. $
  11382. Ket
  11383. End
  11384. ------------------------------------------------------------------
  11385. /\n+\D \n+\d \n+\S \n+\s \n+\W \n+\w \n+. \n+\R \n+\H \n+\h \n+\V \n+\v \n+\Z \n+\z \n+$/Bx
  11386. ------------------------------------------------------------------
  11387. Bra
  11388. \x0a+
  11389. \D
  11390. \x0a++
  11391. \d
  11392. \x0a++
  11393. \S
  11394. \x0a+
  11395. \s
  11396. \x0a+
  11397. \W
  11398. \x0a++
  11399. \w
  11400. \x0a+
  11401. Any
  11402. \x0a+
  11403. \R
  11404. \x0a+
  11405. \H
  11406. \x0a++
  11407. \h
  11408. \x0a++
  11409. \V
  11410. \x0a+
  11411. \v
  11412. \x0a+
  11413. \Z
  11414. \x0a++
  11415. \z
  11416. \x0a+
  11417. $
  11418. Ket
  11419. End
  11420. ------------------------------------------------------------------
  11421. / .+\D .+\d .+\S .+\s .+\W .+\w .+. .+\R .+\H .+\h .+\V .+\v .+\Z .+\z .+$/Bx
  11422. ------------------------------------------------------------------
  11423. Bra
  11424. Any+
  11425. \D
  11426. Any+
  11427. \d
  11428. Any+
  11429. \S
  11430. Any+
  11431. \s
  11432. Any+
  11433. \W
  11434. Any+
  11435. \w
  11436. Any+
  11437. Any
  11438. Any++
  11439. \R
  11440. Any+
  11441. \H
  11442. Any+
  11443. \h
  11444. Any+
  11445. \V
  11446. Any+
  11447. \v
  11448. Any+
  11449. \Z
  11450. Any++
  11451. \z
  11452. Any+
  11453. $
  11454. Ket
  11455. End
  11456. ------------------------------------------------------------------
  11457. / .+\D .+\d .+\S .+\s .+\W .+\w .+. .+\R .+\H .+\h .+\V .+\v .+\Z .+\z .+$/Bsx
  11458. ------------------------------------------------------------------
  11459. Bra
  11460. AllAny+
  11461. \D
  11462. AllAny+
  11463. \d
  11464. AllAny+
  11465. \S
  11466. AllAny+
  11467. \s
  11468. AllAny+
  11469. \W
  11470. AllAny+
  11471. \w
  11472. AllAny+
  11473. AllAny
  11474. AllAny+
  11475. \R
  11476. AllAny+
  11477. \H
  11478. AllAny+
  11479. \h
  11480. AllAny+
  11481. \V
  11482. AllAny+
  11483. \v
  11484. AllAny+
  11485. \Z
  11486. AllAny++
  11487. \z
  11488. AllAny+
  11489. $
  11490. Ket
  11491. End
  11492. ------------------------------------------------------------------
  11493. / \D+$ \d+$ \S+$ \s+$ \W+$ \w+$ \R+$ \H+$ \h+$ \V+$ \v+$ a+$ \n+$ .+$ .+$/Bmx
  11494. ------------------------------------------------------------------
  11495. Bra
  11496. \D+
  11497. /m $
  11498. \d++
  11499. /m $
  11500. \S++
  11501. /m $
  11502. \s+
  11503. /m $
  11504. \W+
  11505. /m $
  11506. \w++
  11507. /m $
  11508. \R+
  11509. /m $
  11510. \H+
  11511. /m $
  11512. \h+
  11513. /m $
  11514. \V+
  11515. /m $
  11516. \v+
  11517. /m $
  11518. a+
  11519. /m $
  11520. \x0a+
  11521. /m $
  11522. Any+
  11523. /m $
  11524. Any+
  11525. /m $
  11526. Ket
  11527. End
  11528. ------------------------------------------------------------------
  11529. /(?=a+)a(a+)++a/B
  11530. ------------------------------------------------------------------
  11531. Bra
  11532. Assert
  11533. a++
  11534. Ket
  11535. a
  11536. CBraPos 1
  11537. a+
  11538. KetRpos
  11539. a
  11540. Ket
  11541. End
  11542. ------------------------------------------------------------------
  11543. /a+(bb|cc)a+(?:bb|cc)a+(?>bb|cc)a+(?:bb|cc)+a+(aa)a+(?:bb|aa)/B
  11544. ------------------------------------------------------------------
  11545. Bra
  11546. a++
  11547. CBra 1
  11548. bb
  11549. Alt
  11550. cc
  11551. Ket
  11552. a++
  11553. Bra
  11554. bb
  11555. Alt
  11556. cc
  11557. Ket
  11558. a++
  11559. Once
  11560. bb
  11561. Alt
  11562. cc
  11563. Ket
  11564. a++
  11565. Bra
  11566. bb
  11567. Alt
  11568. cc
  11569. KetRmax
  11570. a+
  11571. CBra 2
  11572. aa
  11573. Ket
  11574. a+
  11575. Bra
  11576. bb
  11577. Alt
  11578. aa
  11579. Ket
  11580. Ket
  11581. End
  11582. ------------------------------------------------------------------
  11583. /a+(bb|cc)?#a+(?:bb|cc)??#a+(?:bb|cc)?+#a+(?:bb|cc)*#a+(bb|cc)?a#a+(?:aa)?/B
  11584. ------------------------------------------------------------------
  11585. Bra
  11586. a++
  11587. Brazero
  11588. CBra 1
  11589. bb
  11590. Alt
  11591. cc
  11592. Ket
  11593. #
  11594. a++
  11595. Braminzero
  11596. Bra
  11597. bb
  11598. Alt
  11599. cc
  11600. Ket
  11601. #
  11602. a++
  11603. Once
  11604. Brazero
  11605. Bra
  11606. bb
  11607. Alt
  11608. cc
  11609. Ket
  11610. Ket
  11611. #
  11612. a++
  11613. Brazero
  11614. Bra
  11615. bb
  11616. Alt
  11617. cc
  11618. KetRmax
  11619. #
  11620. a+
  11621. Brazero
  11622. CBra 2
  11623. bb
  11624. Alt
  11625. cc
  11626. Ket
  11627. a#
  11628. a+
  11629. Brazero
  11630. Bra
  11631. aa
  11632. Ket
  11633. Ket
  11634. End
  11635. ------------------------------------------------------------------
  11636. /a+(?:bb)?a#a+(?:|||)#a+(?:|b)a#a+(?:|||)?a/B
  11637. ------------------------------------------------------------------
  11638. Bra
  11639. a+
  11640. Brazero
  11641. Bra
  11642. bb
  11643. Ket
  11644. a#
  11645. a++
  11646. Bra
  11647. Alt
  11648. Alt
  11649. Alt
  11650. Ket
  11651. #
  11652. a+
  11653. Bra
  11654. Alt
  11655. b
  11656. Ket
  11657. a#
  11658. a+
  11659. Brazero
  11660. Bra
  11661. Alt
  11662. Alt
  11663. Alt
  11664. Ket
  11665. a
  11666. Ket
  11667. End
  11668. ------------------------------------------------------------------
  11669. /[ab]*/B
  11670. ------------------------------------------------------------------
  11671. Bra
  11672. [ab]*+
  11673. Ket
  11674. End
  11675. ------------------------------------------------------------------
  11676. aaaa
  11677. 0: aaaa
  11678. /[ab]*?/B
  11679. ------------------------------------------------------------------
  11680. Bra
  11681. [ab]*?
  11682. Ket
  11683. End
  11684. ------------------------------------------------------------------
  11685. aaaa
  11686. 0:
  11687. /[ab]?/B
  11688. ------------------------------------------------------------------
  11689. Bra
  11690. [ab]?+
  11691. Ket
  11692. End
  11693. ------------------------------------------------------------------
  11694. aaaa
  11695. 0: a
  11696. /[ab]??/B
  11697. ------------------------------------------------------------------
  11698. Bra
  11699. [ab]??
  11700. Ket
  11701. End
  11702. ------------------------------------------------------------------
  11703. aaaa
  11704. 0:
  11705. /[ab]+/B
  11706. ------------------------------------------------------------------
  11707. Bra
  11708. [ab]++
  11709. Ket
  11710. End
  11711. ------------------------------------------------------------------
  11712. aaaa
  11713. 0: aaaa
  11714. /[ab]+?/B
  11715. ------------------------------------------------------------------
  11716. Bra
  11717. [ab]+?
  11718. Ket
  11719. End
  11720. ------------------------------------------------------------------
  11721. aaaa
  11722. 0: a
  11723. /[ab]{2,3}/B
  11724. ------------------------------------------------------------------
  11725. Bra
  11726. [ab]{2,3}+
  11727. Ket
  11728. End
  11729. ------------------------------------------------------------------
  11730. aaaa
  11731. 0: aaa
  11732. /[ab]{2,3}?/B
  11733. ------------------------------------------------------------------
  11734. Bra
  11735. [ab]{2,3}?
  11736. Ket
  11737. End
  11738. ------------------------------------------------------------------
  11739. aaaa
  11740. 0: aa
  11741. /[ab]{2,}/B
  11742. ------------------------------------------------------------------
  11743. Bra
  11744. [ab]{2,}+
  11745. Ket
  11746. End
  11747. ------------------------------------------------------------------
  11748. aaaa
  11749. 0: aaaa
  11750. /[ab]{2,}?/B
  11751. ------------------------------------------------------------------
  11752. Bra
  11753. [ab]{2,}?
  11754. Ket
  11755. End
  11756. ------------------------------------------------------------------
  11757. aaaa
  11758. 0: aa
  11759. /\d+\s{0,5}=\s*\S?=\w{0,4}\W*/B
  11760. ------------------------------------------------------------------
  11761. Bra
  11762. \d++
  11763. \s{0,5}+
  11764. =
  11765. \s*+
  11766. \S?
  11767. =
  11768. \w{0,4}+
  11769. \W*+
  11770. Ket
  11771. End
  11772. ------------------------------------------------------------------
  11773. /[a-d]{5,12}[e-z0-9]*#[^a-z]+[b-y]*a[2-7]?[^0-9a-z]+/B
  11774. ------------------------------------------------------------------
  11775. Bra
  11776. [a-d]{5,12}+
  11777. [0-9e-z]*+
  11778. #
  11779. [\x00-`{-\xff] (neg)++
  11780. [b-y]*+
  11781. a
  11782. [2-7]?+
  11783. [\x00-/:-`{-\xff] (neg)++
  11784. Ket
  11785. End
  11786. ------------------------------------------------------------------
  11787. /[a-z]*\s#[ \t]?\S#[a-c]*\S#[C-G]+?\d#[4-8]*\D#[4-9,]*\D#[!$]{0,5}\w#[M-Xf-l]+\W#[a-c,]?\W/B
  11788. ------------------------------------------------------------------
  11789. Bra
  11790. [a-z]*+
  11791. \s
  11792. #
  11793. [\x09 ]?+
  11794. \S
  11795. #
  11796. [a-c]*
  11797. \S
  11798. #
  11799. [C-G]++
  11800. \d
  11801. #
  11802. [4-8]*+
  11803. \D
  11804. #
  11805. [,4-9]*
  11806. \D
  11807. #
  11808. [!$]{0,5}+
  11809. \w
  11810. #
  11811. [M-Xf-l]++
  11812. \W
  11813. #
  11814. [,a-c]?
  11815. \W
  11816. Ket
  11817. End
  11818. ------------------------------------------------------------------
  11819. /a+(aa|bb)*c#a*(bb|cc)*a#a?(bb|cc)*d#[a-f]*(g|hh)*f/B
  11820. ------------------------------------------------------------------
  11821. Bra
  11822. a+
  11823. Brazero
  11824. CBra 1
  11825. aa
  11826. Alt
  11827. bb
  11828. KetRmax
  11829. c#
  11830. a*
  11831. Brazero
  11832. CBra 2
  11833. bb
  11834. Alt
  11835. cc
  11836. KetRmax
  11837. a#
  11838. a?+
  11839. Brazero
  11840. CBra 3
  11841. bb
  11842. Alt
  11843. cc
  11844. KetRmax
  11845. d#
  11846. [a-f]*
  11847. Brazero
  11848. CBra 4
  11849. g
  11850. Alt
  11851. hh
  11852. KetRmax
  11853. f
  11854. Ket
  11855. End
  11856. ------------------------------------------------------------------
  11857. /[a-f]*(g|hh|i)*i#[a-x]{4,}(y{0,6})*y#[a-k]+(ll|mm)+n/B
  11858. ------------------------------------------------------------------
  11859. Bra
  11860. [a-f]*+
  11861. Brazero
  11862. CBra 1
  11863. g
  11864. Alt
  11865. hh
  11866. Alt
  11867. i
  11868. KetRmax
  11869. i#
  11870. [a-x]{4,}
  11871. Brazero
  11872. SCBra 2
  11873. y{0,6}
  11874. KetRmax
  11875. y#
  11876. [a-k]++
  11877. CBra 3
  11878. ll
  11879. Alt
  11880. mm
  11881. KetRmax
  11882. n
  11883. Ket
  11884. End
  11885. ------------------------------------------------------------------
  11886. /[a-f]*(?>gg|hh)+#[a-f]*(?>gg|hh)?#[a-f]*(?>gg|hh)*a#[a-f]*(?>gg|hh)*h/B
  11887. ------------------------------------------------------------------
  11888. Bra
  11889. [a-f]*+
  11890. Once
  11891. gg
  11892. Alt
  11893. hh
  11894. KetRmax
  11895. #
  11896. [a-f]*+
  11897. Brazero
  11898. Once
  11899. gg
  11900. Alt
  11901. hh
  11902. Ket
  11903. #
  11904. [a-f]*
  11905. Brazero
  11906. Once
  11907. gg
  11908. Alt
  11909. hh
  11910. KetRmax
  11911. a#
  11912. [a-f]*+
  11913. Brazero
  11914. Once
  11915. gg
  11916. Alt
  11917. hh
  11918. KetRmax
  11919. h
  11920. Ket
  11921. End
  11922. ------------------------------------------------------------------
  11923. /[a-c]*d/IB
  11924. ------------------------------------------------------------------
  11925. Bra
  11926. [a-c]*+
  11927. d
  11928. Ket
  11929. End
  11930. ------------------------------------------------------------------
  11931. Capture group count = 0
  11932. Starting code units: a b c d
  11933. Last code unit = 'd'
  11934. Subject length lower bound = 1
  11935. /[a-c]+d/IB
  11936. ------------------------------------------------------------------
  11937. Bra
  11938. [a-c]++
  11939. d
  11940. Ket
  11941. End
  11942. ------------------------------------------------------------------
  11943. Capture group count = 0
  11944. Starting code units: a b c
  11945. Last code unit = 'd'
  11946. Subject length lower bound = 2
  11947. /[a-c]?d/IB
  11948. ------------------------------------------------------------------
  11949. Bra
  11950. [a-c]?+
  11951. d
  11952. Ket
  11953. End
  11954. ------------------------------------------------------------------
  11955. Capture group count = 0
  11956. Starting code units: a b c d
  11957. Last code unit = 'd'
  11958. Subject length lower bound = 1
  11959. /[a-c]{4,6}d/IB
  11960. ------------------------------------------------------------------
  11961. Bra
  11962. [a-c]{4,6}+
  11963. d
  11964. Ket
  11965. End
  11966. ------------------------------------------------------------------
  11967. Capture group count = 0
  11968. Starting code units: a b c
  11969. Last code unit = 'd'
  11970. Subject length lower bound = 5
  11971. /[a-c]{0,6}d/IB
  11972. ------------------------------------------------------------------
  11973. Bra
  11974. [a-c]{0,6}+
  11975. d
  11976. Ket
  11977. End
  11978. ------------------------------------------------------------------
  11979. Capture group count = 0
  11980. Starting code units: a b c d
  11981. Last code unit = 'd'
  11982. Subject length lower bound = 1
  11983. # End of special auto-possessive tests
  11984. /^A\o{1239}B/
  11985. Failed: error 164 at offset 8: non-octal character in \o{} (closing brace missing?)
  11986. A\123B
  11987. /^A\oB/
  11988. Failed: error 155 at offset 4: missing opening brace after \o
  11989. /^A\x{zz}B/
  11990. Failed: error 167 at offset 5: non-hex character in \x{} (closing brace missing?)
  11991. /^A\x{12Z/
  11992. Failed: error 167 at offset 7: non-hex character in \x{} (closing brace missing?)
  11993. /^A\x{/
  11994. Failed: error 178 at offset 5: digits missing in \x{} or \o{} or \N{U+}
  11995. /[ab]++/B,no_auto_possess
  11996. ------------------------------------------------------------------
  11997. Bra
  11998. [ab]++
  11999. Ket
  12000. End
  12001. ------------------------------------------------------------------
  12002. /[^ab]*+/B,no_auto_possess
  12003. ------------------------------------------------------------------
  12004. Bra
  12005. [\x00-`c-\xff] (neg)*+
  12006. Ket
  12007. End
  12008. ------------------------------------------------------------------
  12009. /a{4}+/B,no_auto_possess
  12010. ------------------------------------------------------------------
  12011. Bra
  12012. a{4}
  12013. Ket
  12014. End
  12015. ------------------------------------------------------------------
  12016. /a{4}+/Bi,no_auto_possess
  12017. ------------------------------------------------------------------
  12018. Bra
  12019. /i a{4}
  12020. Ket
  12021. End
  12022. ------------------------------------------------------------------
  12023. /[a-[:digit:]]+/
  12024. Failed: error 150 at offset 4: invalid range in character class
  12025. /[A-[:digit:]]+/
  12026. Failed: error 150 at offset 4: invalid range in character class
  12027. /[a-[.xxx.]]+/
  12028. Failed: error 150 at offset 4: invalid range in character class
  12029. /[a-[=xxx=]]+/
  12030. Failed: error 150 at offset 4: invalid range in character class
  12031. /[a-[!xxx!]]+/
  12032. Failed: error 108 at offset 3: range out of order in character class
  12033. /[A-[!xxx!]]+/
  12034. A]]]
  12035. 0: A]]]
  12036. /[a-\d]+/
  12037. Failed: error 150 at offset 5: invalid range in character class
  12038. /(?<0abc>xx)/
  12039. Failed: error 144 at offset 3: subpattern name must start with a non-digit
  12040. /(?&1abc)xx(?<1abc>y)/
  12041. Failed: error 144 at offset 3: subpattern name must start with a non-digit
  12042. /(?<ab-cd>xx)/
  12043. Failed: error 142 at offset 5: syntax error in subpattern name (missing terminator?)
  12044. /(?'0abc'xx)/
  12045. Failed: error 144 at offset 3: subpattern name must start with a non-digit
  12046. /(?P<0abc>xx)/
  12047. Failed: error 144 at offset 4: subpattern name must start with a non-digit
  12048. /\k<5ghj>/
  12049. Failed: error 144 at offset 3: subpattern name must start with a non-digit
  12050. /\k'5ghj'/
  12051. Failed: error 144 at offset 3: subpattern name must start with a non-digit
  12052. /\k{2fgh}/
  12053. Failed: error 144 at offset 3: subpattern name must start with a non-digit
  12054. /(?P=8yuki)/
  12055. Failed: error 144 at offset 4: subpattern name must start with a non-digit
  12056. /\g{4df}/
  12057. Failed: error 157 at offset 2: \g is not followed by a braced, angle-bracketed, or quoted name/number or by a plain number
  12058. /(?&1abc)xx(?<1abc>y)/
  12059. Failed: error 144 at offset 3: subpattern name must start with a non-digit
  12060. /(?P>1abc)xx(?<1abc>y)/
  12061. Failed: error 144 at offset 4: subpattern name must start with a non-digit
  12062. /\g'3gh'/
  12063. Failed: error 157 at offset 2: \g is not followed by a braced, angle-bracketed, or quoted name/number or by a plain number
  12064. /\g<5fg>/
  12065. Failed: error 157 at offset 2: \g is not followed by a braced, angle-bracketed, or quoted name/number or by a plain number
  12066. /(?(<4gh>)abc)/
  12067. Failed: error 144 at offset 4: subpattern name must start with a non-digit
  12068. /(?('4gh')abc)/
  12069. Failed: error 144 at offset 4: subpattern name must start with a non-digit
  12070. /(?(4gh)abc)/
  12071. Failed: error 124 at offset 4: missing closing parenthesis for condition
  12072. /(?(R&6yh)abc)/
  12073. Failed: error 144 at offset 5: subpattern name must start with a non-digit
  12074. /(((a\2)|(a*)\g<-1>))*a?/B
  12075. ------------------------------------------------------------------
  12076. Bra
  12077. Brazero
  12078. SCBra 1
  12079. CBra 2
  12080. CBra 3
  12081. a
  12082. \2
  12083. Ket
  12084. Alt
  12085. CBra 4
  12086. a*
  12087. Ket
  12088. Recurse
  12089. Ket
  12090. KetRmax
  12091. a?+
  12092. Ket
  12093. End
  12094. ------------------------------------------------------------------
  12095. # Test the ugly "start or end of word" compatibility syntax.
  12096. /[[:<:]]red[[:>:]]/B
  12097. ------------------------------------------------------------------
  12098. Bra
  12099. \b
  12100. Assert
  12101. \w
  12102. Ket
  12103. red
  12104. \b
  12105. Assert back
  12106. Reverse
  12107. \w
  12108. Ket
  12109. Ket
  12110. End
  12111. ------------------------------------------------------------------
  12112. little red riding hood
  12113. 0: red
  12114. a /red/ thing
  12115. 0: red
  12116. red is a colour
  12117. 0: red
  12118. put it all on red
  12119. 0: red
  12120. \= Expect no match
  12121. no reduction
  12122. No match
  12123. Alfred Winifred
  12124. No match
  12125. /[a[:<:]] should give error/
  12126. Failed: error 130 at offset 4: unknown POSIX class name
  12127. /(?=ab\K)/aftertext,allow_lookaround_bsk
  12128. abcd\=startchar
  12129. Start of matched string is beyond its end - displaying from end to start.
  12130. 0: ab
  12131. 0+ abcd
  12132. /abcd/newline=lf,firstline
  12133. \= Expect no match
  12134. xx\nxabcd
  12135. No match
  12136. # Test stack guard external calls.
  12137. /(((a)))/stackguard=1
  12138. Failed: error 133 at offset 7: parentheses are too deeply nested (stack check)
  12139. /(((a)))/stackguard=2
  12140. Failed: error 133 at offset 7: parentheses are too deeply nested (stack check)
  12141. /(((a)))/stackguard=3
  12142. /(((((a)))))/
  12143. # End stack guard tests
  12144. /^\w+(?>\s*)(?<=\w)/B
  12145. ------------------------------------------------------------------
  12146. Bra
  12147. ^
  12148. \w+
  12149. Once
  12150. \s*+
  12151. Ket
  12152. Assert back
  12153. Reverse
  12154. \w
  12155. Ket
  12156. Ket
  12157. End
  12158. ------------------------------------------------------------------
  12159. /\othing/
  12160. Failed: error 155 at offset 2: missing opening brace after \o
  12161. /\o{}/
  12162. Failed: error 178 at offset 3: digits missing in \x{} or \o{} or \N{U+}
  12163. /\o{whatever}/
  12164. Failed: error 164 at offset 3: non-octal character in \o{} (closing brace missing?)
  12165. /\xthing/
  12166. /\x{}/
  12167. Failed: error 178 at offset 3: digits missing in \x{} or \o{} or \N{U+}
  12168. /\x{whatever}/
  12169. Failed: error 167 at offset 3: non-hex character in \x{} (closing brace missing?)
  12170. /A\8B/
  12171. Failed: error 115 at offset 2: reference to non-existent subpattern
  12172. /A\9B/
  12173. Failed: error 115 at offset 2: reference to non-existent subpattern
  12174. # This one is here because Perl fails to match "12" for this pattern when the $
  12175. # is present.
  12176. /^(?(?=abc)\w{3}:|\d\d)$/
  12177. abc:
  12178. 0: abc:
  12179. 12
  12180. 0: 12
  12181. \= Expect no match
  12182. 123
  12183. No match
  12184. xyz
  12185. No match
  12186. # Perl gets this one wrong, giving "a" as the after text for ca and failing to
  12187. # match for cd.
  12188. /(?(?=ab)ab)/aftertext
  12189. abxxx
  12190. 0: ab
  12191. 0+ xxx
  12192. ca
  12193. 0:
  12194. 0+ ca
  12195. cd
  12196. 0:
  12197. 0+ cd
  12198. # This should test both paths for processing OP_RECURSE.
  12199. /(?(R)a+|(?R)b)/
  12200. aaaabcde
  12201. 0: aaaab
  12202. aaaabcde\=ovector=100
  12203. 0: aaaab
  12204. /a*?b*?/
  12205. ab
  12206. 0:
  12207. /(*NOTEMPTY)a*?b*?/
  12208. ab
  12209. 0: a
  12210. ba
  12211. 0: b
  12212. cb
  12213. 0: b
  12214. /(*NOTEMPTY_ATSTART)a*?b*?/aftertext
  12215. ab
  12216. 0: a
  12217. 0+ b
  12218. cdab
  12219. 0:
  12220. 0+ dab
  12221. /(?(VERSION>=10.0)yes|no)/I
  12222. Capture group count = 0
  12223. Subject length lower bound = 2
  12224. yesno
  12225. 0: yes
  12226. /(?(VERSION>=10.04)yes|no)/
  12227. yesno
  12228. 0: yes
  12229. /(?(VERSION=8)yes){3}/BI,aftertext
  12230. ------------------------------------------------------------------
  12231. Bra
  12232. Cond
  12233. Cond false
  12234. yes
  12235. Ket
  12236. Ket
  12237. End
  12238. ------------------------------------------------------------------
  12239. Capture group count = 0
  12240. May match empty string
  12241. Subject length lower bound = 0
  12242. yesno
  12243. 0:
  12244. 0+ yesno
  12245. /(?(VERSION=8)yes|no){3}/I
  12246. Capture group count = 0
  12247. Subject length lower bound = 6
  12248. yesnononoyes
  12249. 0: nonono
  12250. \= Expect no match
  12251. yesno
  12252. No match
  12253. /(?:(?<VERSION>abc)|xyz)(?(VERSION)yes|no)/I
  12254. Capture group count = 1
  12255. Max back reference = 1
  12256. Named capture groups:
  12257. VERSION 1
  12258. Starting code units: a x
  12259. Subject length lower bound = 5
  12260. abcyes
  12261. 0: abcyes
  12262. 1: abc
  12263. xyzno
  12264. 0: xyzno
  12265. \= Expect no match
  12266. abcno
  12267. No match
  12268. xyzyes
  12269. No match
  12270. /(?(VERSION<10)yes|no)/
  12271. Failed: error 179 at offset 10: syntax error or number too big in (?(VERSION condition
  12272. /(?(VERSION>10)yes|no)/
  12273. Failed: error 179 at offset 11: syntax error or number too big in (?(VERSION condition
  12274. /(?(VERSION>=10.0.0)yes|no)/
  12275. Failed: error 179 at offset 16: syntax error or number too big in (?(VERSION condition
  12276. /(?(VERSION=10.101)yes|no)/
  12277. Failed: error 179 at offset 16: syntax error or number too big in (?(VERSION condition
  12278. /abcd/I
  12279. Capture group count = 0
  12280. First code unit = 'a'
  12281. Last code unit = 'd'
  12282. Subject length lower bound = 4
  12283. /abcd/I,no_start_optimize
  12284. Capture group count = 0
  12285. Options: no_start_optimize
  12286. /(|ab)*?d/I
  12287. Capture group count = 1
  12288. Starting code units: a d
  12289. Last code unit = 'd'
  12290. Subject length lower bound = 1
  12291. abd
  12292. 0: abd
  12293. 1: ab
  12294. xyd
  12295. 0: d
  12296. /(|ab)*?d/I,no_start_optimize
  12297. Capture group count = 1
  12298. Options: no_start_optimize
  12299. abd
  12300. 0: abd
  12301. 1: ab
  12302. xyd
  12303. 0: d
  12304. /\k<A>*(?<A>aa)(?<A>bb)/match_unset_backref,dupnames
  12305. aabb
  12306. 0: aabb
  12307. 1: aa
  12308. 2: bb
  12309. /(((((a)))))/parens_nest_limit=2
  12310. Failed: error 119 at offset 3: parentheses are too deeply nested
  12311. /abc/replace=XYZ
  12312. 123123
  12313. 0: 123123
  12314. 123abc123
  12315. 1: 123XYZ123
  12316. 123abc123abc123
  12317. 1: 123XYZ123abc123
  12318. 123123\=zero_terminate
  12319. 0: 123123
  12320. 123abc123\=zero_terminate
  12321. 1: 123XYZ123
  12322. 123abc123abc123\=zero_terminate
  12323. 1: 123XYZ123abc123
  12324. /abc/g,replace=XYZ
  12325. 123abc123
  12326. 1: 123XYZ123
  12327. 123abc123abc123
  12328. 2: 123XYZ123XYZ123
  12329. /abc/replace=X$$Z
  12330. 123abc123
  12331. 1: 123X$Z123
  12332. /abc/g,replace=X$$Z
  12333. 123abc123abc123
  12334. 2: 123X$Z123X$Z123
  12335. /a(b)c(d)e/replace=X$1Y${2}Z
  12336. "abcde"
  12337. 1: "XbYdZ"
  12338. /a(b)c(d)e/replace=X$1Y${2}Z,global
  12339. "abcde-abcde"
  12340. 2: "XbYdZ-XbYdZ"
  12341. /a(?<ONE>b)c(?<TWO>d)e/replace=X$ONE+${TWO}Z
  12342. "abcde"
  12343. 1: "Xb+dZ"
  12344. /a(?<ONE>b)c(?<TWO>d)e/g,replace=X$ONE+${TWO}Z
  12345. "abcde-abcde-"
  12346. 2: "Xb+dZ-Xb+dZ-"
  12347. /abc/replace=a$++
  12348. 123abc
  12349. Failed: error -35 at offset 2 in replacement: invalid replacement string
  12350. /abc/replace=a$bad
  12351. 123abc
  12352. Failed: error -49 at offset 5 in replacement: unknown substring
  12353. /abc/replace=a${A234567890123456789_123456789012}z
  12354. 123abc
  12355. Failed: error -49 at offset 36 in replacement: unknown substring
  12356. /abc/replace=a${A23456789012345678901234567890123}z
  12357. 123abc
  12358. Failed: error -35 at offset 35 in replacement: invalid replacement string
  12359. /abc/replace=a${bcd
  12360. 123abc
  12361. Failed: error -58 at offset 6 in replacement: expected closing curly bracket in replacement string
  12362. /abc/replace=a${b+d}z
  12363. 123abc
  12364. Failed: error -58 at offset 4 in replacement: expected closing curly bracket in replacement string
  12365. /abc/replace=[10]XYZ
  12366. 123abc123
  12367. 1: 123XYZ123
  12368. /abc/replace=[9]XYZ
  12369. 123abc123
  12370. Failed: error -48: no more memory
  12371. /abc/replace=xyz
  12372. 1abc2\=partial_hard
  12373. Failed: error -34: bad option value
  12374. /abc/replace=xyz
  12375. 123abc456
  12376. 1: 123xyz456
  12377. 123abc456\=replace=pqr
  12378. 1: 123pqr456
  12379. 123abc456abc789
  12380. 1: 123xyz456abc789
  12381. 123abc456abc789\=g
  12382. 2: 123xyz456xyz789
  12383. /(?<=abc)(|def)/g,replace=<$0>
  12384. 123abcxyzabcdef789abcpqr
  12385. 4: 123abc<>xyzabc<><def>789abc<>pqr
  12386. /./replace=$0
  12387. a
  12388. 1: a
  12389. /(.)(.)/replace=$2+$1
  12390. abc
  12391. 1: b+ac
  12392. /(?<A>.)(?<B>.)/replace=$B+$A
  12393. abc
  12394. 1: b+ac
  12395. /(.)(.)/g,replace=$2$1
  12396. abcdefgh
  12397. 4: badcfehg
  12398. /(*:pear)apple|(*:orange)lemon|(*:strawberry)blackberry/g,replace=${*MARK}
  12399. apple lemon blackberry
  12400. 3: pear orange strawberry
  12401. apple strudel
  12402. 1: pear strudel
  12403. fruitless
  12404. 0: fruitless
  12405. /(*:pear)apple|(*:orange)lemon|(*:strawberry)blackberry/replace=${*MARK} sauce,
  12406. apple lemon blackberry
  12407. 1: pear sauce lemon blackberry
  12408. /(*:pear)apple|(*:orange)lemon|(*:strawberry)blackberry/g,replace=<$*MARK>
  12409. apple lemon blackberry
  12410. 3: <pear> <orange> <strawberry>
  12411. apple strudel
  12412. 1: <pear> strudel
  12413. fruitless
  12414. 0: fruitless
  12415. /(*:pear)apple/g,replace=${*MARKING}
  12416. apple lemon blackberry
  12417. Failed: error -35 at offset 11 in replacement: invalid replacement string
  12418. /(*:pear)apple/g,replace=${*MARK-time
  12419. apple lemon blackberry
  12420. Failed: error -58 at offset 7 in replacement: expected closing curly bracket in replacement string
  12421. /(*:pear)apple/g,replace=${*mark}
  12422. apple lemon blackberry
  12423. Failed: error -35 at offset 8 in replacement: invalid replacement string
  12424. /(*:pear)apple|(*:orange)lemon|(*:strawberry)blackberry/g,replace=<$*MARKET>
  12425. apple lemon blackberry
  12426. Failed: error -35 at offset 9 in replacement: invalid replacement string
  12427. /(*:pear)apple|(*:orange)lemon|(*:strawberry)blackberry/g,replace=[22]${*MARK}
  12428. apple lemon blackberry
  12429. Failed: error -48: no more memory
  12430. apple lemon blackberry\=substitute_overflow_length
  12431. Failed: error -48: no more memory: 23 code units are needed
  12432. /(*:pear)apple|(*:orange)lemon|(*:strawberry)blackberry/g,replace=[23]${*MARK}
  12433. apple lemon blackberry
  12434. 3: pear orange strawberry
  12435. /abc/
  12436. 123abc123\=replace=[9]XYZ
  12437. Failed: error -48: no more memory
  12438. 123abc123\=substitute_overflow_length,replace=[9]XYZ
  12439. Failed: error -48: no more memory: 10 code units are needed
  12440. 123abc123\=substitute_overflow_length,replace=[6]XYZ
  12441. Failed: error -48: no more memory: 10 code units are needed
  12442. 123abc123\=substitute_overflow_length,replace=[1]XYZ
  12443. Failed: error -48: no more memory: 10 code units are needed
  12444. 123abc123\=substitute_overflow_length,replace=[0]XYZ
  12445. Failed: error -48: no more memory: 10 code units are needed
  12446. /a(b)c/
  12447. 123abc123\=replace=[9]x$1z
  12448. Failed: error -48: no more memory
  12449. 123abc123\=substitute_overflow_length,replace=[9]x$1z
  12450. Failed: error -48: no more memory: 10 code units are needed
  12451. 123abc123\=substitute_overflow_length,replace=[6]x$1z
  12452. Failed: error -48: no more memory: 10 code units are needed
  12453. 123abc123\=substitute_overflow_length,replace=[1]x$1z
  12454. Failed: error -48: no more memory: 10 code units are needed
  12455. 123abc123\=substitute_overflow_length,replace=[0]x$1z
  12456. Failed: error -48: no more memory: 10 code units are needed
  12457. "((?=(?(?=(?(?=(?(?=()))))))))"
  12458. a
  12459. 0:
  12460. 1:
  12461. 2:
  12462. "(?(?=)==)(((((((((?=)))))))))"
  12463. \= Expect no match
  12464. a
  12465. No match
  12466. /(a)(b)|(c)/
  12467. XcX\=ovector=2,get=1,get=2,get=3,get=4,getall
  12468. Matched, but too many substrings
  12469. 0: c
  12470. 1: <unset>
  12471. Get substring 1 failed (-55): requested value is not set
  12472. Get substring 2 failed (-54): requested value is not available
  12473. Get substring 3 failed (-54): requested value is not available
  12474. Get substring 4 failed (-49): unknown substring
  12475. 0L c
  12476. 1L
  12477. /x(?=ab\K)/allow_lookaround_bsk
  12478. xab\=get=0
  12479. Start of matched string is beyond its end - displaying from end to start.
  12480. 0: ab
  12481. 0G (0)
  12482. xab\=copy=0
  12483. Start of matched string is beyond its end - displaying from end to start.
  12484. 0: ab
  12485. 0C (0)
  12486. xab\=getall
  12487. Start of matched string is beyond its end - displaying from end to start.
  12488. 0: ab
  12489. 0L
  12490. /(?<A>a)|(?<A>b)/dupnames
  12491. a\=ovector=1,copy=A,get=A,get=2
  12492. Matched, but too many substrings
  12493. 0: a
  12494. Copy substring 'A' failed (-54): requested value is not available
  12495. Get substring 2 failed (-54): requested value is not available
  12496. Get substring 'A' failed (-54): requested value is not available
  12497. a\=ovector=2,copy=A,get=A,get=2
  12498. 0: a
  12499. 1: a
  12500. C a (1) A (non-unique)
  12501. Get substring 2 failed (-54): requested value is not available
  12502. G a (1) A (non-unique)
  12503. b\=ovector=2,copy=A,get=A,get=2
  12504. Matched, but too many substrings
  12505. 0: b
  12506. 1: <unset>
  12507. Copy substring 'A' failed (-55): requested value is not set
  12508. Get substring 2 failed (-54): requested value is not available
  12509. Get substring 'A' failed (-55): requested value is not set
  12510. /a(b)c(d)/
  12511. abc\=ph,copy=0,copy=1,getall
  12512. Partial match: abc
  12513. 0C abc (3)
  12514. Copy substring 1 failed (-2): partial match
  12515. get substring list failed (-2): partial match
  12516. /^abc/info
  12517. Capture group count = 0
  12518. Compile options: <none>
  12519. Overall options: anchored
  12520. First code unit = 'a'
  12521. Subject length lower bound = 3
  12522. /^abc/info,no_dotstar_anchor
  12523. Capture group count = 0
  12524. Compile options: no_dotstar_anchor
  12525. Overall options: anchored no_dotstar_anchor
  12526. First code unit = 'a'
  12527. Subject length lower bound = 3
  12528. /.*\d/info,auto_callout
  12529. Capture group count = 0
  12530. Options: auto_callout
  12531. First code unit at start or follows newline
  12532. Subject length lower bound = 1
  12533. \= Expect no match
  12534. aaa
  12535. --->aaa
  12536. +0 ^ .*
  12537. +2 ^ ^ \d
  12538. +2 ^ ^ \d
  12539. +2 ^^ \d
  12540. +2 ^ \d
  12541. No match
  12542. /.*\d/info,no_dotstar_anchor,auto_callout
  12543. Capture group count = 0
  12544. Options: auto_callout no_dotstar_anchor
  12545. Subject length lower bound = 1
  12546. \= Expect no match
  12547. aaa
  12548. --->aaa
  12549. +0 ^ .*
  12550. +2 ^ ^ \d
  12551. +2 ^ ^ \d
  12552. +2 ^^ \d
  12553. +2 ^ \d
  12554. +0 ^ .*
  12555. +2 ^ ^ \d
  12556. +2 ^^ \d
  12557. +2 ^ \d
  12558. +0 ^ .*
  12559. +2 ^^ \d
  12560. +2 ^ \d
  12561. No match
  12562. /.*\d/dotall,info
  12563. Capture group count = 0
  12564. Compile options: dotall
  12565. Overall options: anchored dotall
  12566. Subject length lower bound = 1
  12567. /.*\d/dotall,no_dotstar_anchor,info
  12568. Capture group count = 0
  12569. Options: dotall no_dotstar_anchor
  12570. Subject length lower bound = 1
  12571. /(*NO_DOTSTAR_ANCHOR)(?s).*\d/info
  12572. Capture group count = 0
  12573. Compile options: <none>
  12574. Overall options: no_dotstar_anchor
  12575. Subject length lower bound = 1
  12576. '^(?:(a)|b)(?(1)A|B)'
  12577. aA123\=ovector=1
  12578. Matched, but too many substrings
  12579. 0: aA
  12580. aA123\=ovector=2
  12581. 0: aA
  12582. 1: a
  12583. '^(?:(?<AA>a)|b)(?(<AA>)A|B)'
  12584. aA123\=ovector=1
  12585. Matched, but too many substrings
  12586. 0: aA
  12587. aA123\=ovector=2
  12588. 0: aA
  12589. 1: a
  12590. '^(?<AA>)(?:(?<AA>a)|b)(?(<AA>)A|B)'dupnames
  12591. aA123\=ovector=1
  12592. Matched, but too many substrings
  12593. 0: aA
  12594. aA123\=ovector=2
  12595. Matched, but too many substrings
  12596. 0: aA
  12597. 1:
  12598. aA123\=ovector=3
  12599. 0: aA
  12600. 1:
  12601. 2: a
  12602. '^(?:(?<AA>X)|)(?:(?<AA>a)|b)\k{AA}'dupnames
  12603. aa123\=ovector=1
  12604. Matched, but too many substrings
  12605. 0: aa
  12606. aa123\=ovector=2
  12607. Matched, but too many substrings
  12608. 0: aa
  12609. 1: <unset>
  12610. aa123\=ovector=3
  12611. 0: aa
  12612. 1: <unset>
  12613. 2: a
  12614. /(?<N111>(?J)(?<N111>1(111111)11|)1|1|)(?(<N111>)1)/
  12615. /(?<N>(?J)(?<N>))(?-J)\k<N>/
  12616. # Quantifiers are not allowed on condition assertions, but are otherwise
  12617. # OK in conditions.
  12618. /(?(?=0)?)+/
  12619. Failed: error 109 at offset 7: quantifier does not follow a repeatable item
  12620. /(?(?=0)(?=00)?00765)/
  12621. 00765
  12622. 0: 00765
  12623. /(?(?=0)(?=00)?00765|(?!3).56)/
  12624. 00765
  12625. 0: 00765
  12626. 456
  12627. 0: 456
  12628. \= Expect no match
  12629. 356
  12630. No match
  12631. '^(a)*+(\w)'
  12632. g
  12633. 0: g
  12634. 1: <unset>
  12635. 2: g
  12636. g\=ovector=1
  12637. Matched, but too many substrings
  12638. 0: g
  12639. '^(?:a)*+(\w)'
  12640. g
  12641. 0: g
  12642. 1: g
  12643. g\=ovector=1
  12644. Matched, but too many substrings
  12645. 0: g
  12646. # These two pattern showeds up compile-time bugs
  12647. "((?2){0,1999}())?"
  12648. /((?+1)(\1))/B
  12649. ------------------------------------------------------------------
  12650. Bra
  12651. CBra 1
  12652. Recurse
  12653. CBra 2
  12654. \1
  12655. Ket
  12656. Ket
  12657. Ket
  12658. End
  12659. ------------------------------------------------------------------
  12660. # Callouts with string arguments
  12661. /a(?C"/
  12662. Failed: error 181 at offset 4: missing terminating delimiter for callout with string argument
  12663. /a(?C"a/
  12664. Failed: error 181 at offset 4: missing terminating delimiter for callout with string argument
  12665. /a(?C"a"/
  12666. Failed: error 139 at offset 7: closing parenthesis for (?C expected
  12667. /a(?C"a"bcde(?C"b")xyz/
  12668. Failed: error 139 at offset 7: closing parenthesis for (?C expected
  12669. /a(?C"a)b""c")/B
  12670. ------------------------------------------------------------------
  12671. Bra
  12672. a
  12673. CalloutStr "a)b"c" 5 13 0
  12674. Ket
  12675. End
  12676. ------------------------------------------------------------------
  12677. /ab(?C" any text with spaces ")cde/B
  12678. ------------------------------------------------------------------
  12679. Bra
  12680. ab
  12681. CalloutStr " any text with spaces " 6 30 1
  12682. cde
  12683. Ket
  12684. End
  12685. ------------------------------------------------------------------
  12686. abcde
  12687. Callout (6): " any text with spaces "
  12688. --->abcde
  12689. ^ ^ c
  12690. 0: abcde
  12691. 12abcde
  12692. Callout (6): " any text with spaces "
  12693. --->12abcde
  12694. ^ ^ c
  12695. 0: abcde
  12696. /^a(b)c(?C1)def/
  12697. abcdef
  12698. --->abcdef
  12699. 1 ^ ^ d
  12700. 0: abcdef
  12701. 1: b
  12702. /^a(b)c(?C"AB")def/
  12703. abcdef
  12704. Callout (10): "AB"
  12705. --->abcdef
  12706. ^ ^ d
  12707. 0: abcdef
  12708. 1: b
  12709. /^a(b)c(?C1)def/
  12710. abcdef\=callout_capture
  12711. Callout 1: last capture = 1
  12712. 1: b
  12713. --->abcdef
  12714. ^ ^ d
  12715. 0: abcdef
  12716. 1: b
  12717. /^a(b)c(?C{AB})def/B
  12718. ------------------------------------------------------------------
  12719. Bra
  12720. ^
  12721. a
  12722. CBra 1
  12723. b
  12724. Ket
  12725. c
  12726. CalloutStr {AB} 10 14 1
  12727. def
  12728. Ket
  12729. End
  12730. ------------------------------------------------------------------
  12731. abcdef\=callout_capture
  12732. Callout (10): {AB} last capture = 1
  12733. 1: b
  12734. --->abcdef
  12735. ^ ^ d
  12736. 0: abcdef
  12737. 1: b
  12738. /(?C`a``b`)(?C'a''b')(?C"a""b")(?C^a^^b^)(?C%a%%b%)(?C#a##b#)(?C$a$$b$)(?C{a}}b})/B,callout_info
  12739. ------------------------------------------------------------------
  12740. Bra
  12741. CalloutStr `a`b` 4 10 0
  12742. CalloutStr 'a'b' 14 20 0
  12743. CalloutStr "a"b" 24 30 0
  12744. CalloutStr ^a^b^ 34 40 0
  12745. CalloutStr %a%b% 44 50 0
  12746. CalloutStr #a#b# 54 60 0
  12747. CalloutStr $a$b$ 64 70 0
  12748. CalloutStr {a}b} 74 80 0
  12749. Ket
  12750. End
  12751. ------------------------------------------------------------------
  12752. Callout `a`b` (
  12753. Callout 'a'b' (
  12754. Callout "a"b" (
  12755. Callout ^a^b^ (
  12756. Callout %a%b% (
  12757. Callout #a#b# (
  12758. Callout $a$b$ (
  12759. Callout {a}b}
  12760. /(?:a(?C`code`)){3}/B
  12761. ------------------------------------------------------------------
  12762. Bra
  12763. Bra
  12764. a
  12765. CalloutStr `code` 8 14 4
  12766. Ket
  12767. Bra
  12768. a
  12769. CalloutStr `code` 8 14 4
  12770. Ket
  12771. Bra
  12772. a
  12773. CalloutStr `code` 8 14 4
  12774. Ket
  12775. Ket
  12776. End
  12777. ------------------------------------------------------------------
  12778. /^(?(?C25)(?=abc)abcd|xyz)/B,callout_info
  12779. ------------------------------------------------------------------
  12780. Bra
  12781. ^
  12782. Cond
  12783. Callout 25 9 3
  12784. Assert
  12785. abc
  12786. Ket
  12787. abcd
  12788. Alt
  12789. xyz
  12790. Ket
  12791. Ket
  12792. End
  12793. ------------------------------------------------------------------
  12794. Callout 25 (?=
  12795. abcdefg
  12796. --->abcdefg
  12797. 25 ^ (?=
  12798. 0: abcd
  12799. xyz123
  12800. --->xyz123
  12801. 25 ^ (?=
  12802. 0: xyz
  12803. /^(?(?C$abc$)(?=abc)abcd|xyz)/B
  12804. ------------------------------------------------------------------
  12805. Bra
  12806. ^
  12807. Cond
  12808. CalloutStr $abc$ 7 12 3
  12809. Assert
  12810. abc
  12811. Ket
  12812. abcd
  12813. Alt
  12814. xyz
  12815. Ket
  12816. Ket
  12817. End
  12818. ------------------------------------------------------------------
  12819. abcdefg
  12820. Callout (7): $abc$
  12821. --->abcdefg
  12822. ^ (?=
  12823. 0: abcd
  12824. xyz123
  12825. Callout (7): $abc$
  12826. --->xyz123
  12827. ^ (?=
  12828. 0: xyz
  12829. /^ab(?C'first')cd(?C"second")ef/
  12830. abcdefg
  12831. Callout (7): 'first'
  12832. --->abcdefg
  12833. ^ ^ c
  12834. Callout (20): "second"
  12835. --->abcdefg
  12836. ^ ^ e
  12837. 0: abcdef
  12838. /(?:a(?C`code`)){3}X/
  12839. aaaXY
  12840. Callout (8): `code`
  12841. --->aaaXY
  12842. ^^ ){3}
  12843. Callout (8): `code`
  12844. --->aaaXY
  12845. ^ ^ ){3}
  12846. Callout (8): `code`
  12847. --->aaaXY
  12848. ^ ^ ){3}
  12849. 0: aaaX
  12850. # Binary zero in callout string
  12851. # a ( ? C ' x z ' ) b
  12852. / 61 28 3f 43 27 78 00 7a 27 29 62/hex,callout_info
  12853. Callout 'x\x00z' b
  12854. abcdefgh
  12855. Callout (5): 'x\x00z'
  12856. --->abcdefgh
  12857. ^^ b
  12858. 0: ab
  12859. /(?(?!)^)/
  12860. /(?(?!)a|b)/
  12861. bbb
  12862. 0: b
  12863. \= Expect no match
  12864. aaa
  12865. No match
  12866. # JIT gives a different error message for the infinite recursion
  12867. "(*NO_JIT)((?2)+)((?1)){"
  12868. abcd{
  12869. Failed: error -52: nested recursion at the same subject position
  12870. # Perl fails to diagnose the absence of an assertion
  12871. "(?(?<E>.*!.*)?)"
  12872. Failed: error 128 at offset 2: assertion expected after (?( or (?(?C)
  12873. "X((?2)()*+){2}+"B
  12874. ------------------------------------------------------------------
  12875. Bra
  12876. X
  12877. Once
  12878. CBra 1
  12879. Recurse
  12880. Braposzero
  12881. SCBraPos 2
  12882. KetRpos
  12883. Ket
  12884. CBra 1
  12885. Recurse
  12886. Braposzero
  12887. SCBraPos 2
  12888. KetRpos
  12889. Ket
  12890. Ket
  12891. Ket
  12892. End
  12893. ------------------------------------------------------------------
  12894. "X((?2)()*+){2}"B
  12895. ------------------------------------------------------------------
  12896. Bra
  12897. X
  12898. CBra 1
  12899. Recurse
  12900. Braposzero
  12901. SCBraPos 2
  12902. KetRpos
  12903. Ket
  12904. CBra 1
  12905. Recurse
  12906. Braposzero
  12907. SCBraPos 2
  12908. KetRpos
  12909. Ket
  12910. Ket
  12911. End
  12912. ------------------------------------------------------------------
  12913. /(?<=\bABQ(3(?-7)))/
  12914. Failed: error 115 at offset 15: reference to non-existent subpattern
  12915. /(?<=\bABQ(3(?+7)))/
  12916. Failed: error 115 at offset 15: reference to non-existent subpattern
  12917. ";(?<=()((?3))((?2)))"
  12918. Failed: error 125 at offset 1: lookbehind assertion is not fixed length
  12919. # Perl loops on this (PCRE2 used to!)
  12920. /(?<=\Ka)/g,aftertext,allow_lookaround_bsk
  12921. aaaaa
  12922. 0: a
  12923. 0+ aaaa
  12924. 0: a
  12925. 0+ aaa
  12926. 0: a
  12927. 0+ aa
  12928. 0: a
  12929. 0+ a
  12930. 0: a
  12931. 0+
  12932. /(?<=\Ka)/altglobal,aftertext,allow_lookaround_bsk
  12933. aaaaa
  12934. 0: a
  12935. 0+ aaaa
  12936. 0: a
  12937. 0+ aaa
  12938. 0: a
  12939. 0+ aa
  12940. 0: a
  12941. 0+ a
  12942. 0: a
  12943. 0+
  12944. /((?2){73}(?2))((?1))/info
  12945. Capture group count = 2
  12946. May match empty string
  12947. Subject length lower bound = 0
  12948. /abc/
  12949. \= Expect no match
  12950. \[9x!xxx(]{9999}
  12951. No match
  12952. /(abc)*/
  12953. \[abc]{5}
  12954. 0: abcabcabcabcabc
  12955. 1: abc
  12956. /^/gm
  12957. \n\n\n
  12958. 0:
  12959. 0:
  12960. 0:
  12961. /^/gm,alt_circumflex
  12962. \n\n\n
  12963. 0:
  12964. 0:
  12965. 0:
  12966. 0:
  12967. /((((((((x))))))))\81/
  12968. Failed: error 115 at offset 19: reference to non-existent subpattern
  12969. xx1
  12970. /((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((x))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))\80/
  12971. xx
  12972. Matched, but too many substrings
  12973. 0: xx
  12974. 1: x
  12975. 2: x
  12976. 3: x
  12977. 4: x
  12978. 5: x
  12979. 6: x
  12980. 7: x
  12981. 8: x
  12982. 9: x
  12983. 10: x
  12984. 11: x
  12985. 12: x
  12986. 13: x
  12987. 14: x
  12988. /\80/
  12989. Failed: error 115 at offset 2: reference to non-existent subpattern
  12990. /A\8B\9C/
  12991. Failed: error 115 at offset 2: reference to non-existent subpattern
  12992. A8B9C
  12993. /(?x:((?'a')) # comment (with parentheses) and | vertical
  12994. (?-x:#not a comment (?'b')) # this is a comment ()
  12995. (?'c')) # not a comment (?'d')/info
  12996. Capture group count = 5
  12997. Named capture groups:
  12998. a 2
  12999. b 3
  13000. c 4
  13001. d 5
  13002. First code unit = '#'
  13003. Last code unit = ' '
  13004. Subject length lower bound = 32
  13005. /(?|(?'a')(2)(?'b')|(?'a')(?'a')(3))/I,dupnames
  13006. Capture group count = 3
  13007. Named capture groups:
  13008. a 1
  13009. a 2
  13010. b 3
  13011. Options: dupnames
  13012. Starting code units: 2 3
  13013. Subject length lower bound = 1
  13014. A23B
  13015. 0: 2
  13016. 1:
  13017. 2: 2
  13018. 3:
  13019. B32A
  13020. 0: 3
  13021. 1:
  13022. 2:
  13023. 3: 3
  13024. # These are some patterns that used to cause buffer overflows or other errors
  13025. # while compiling.
  13026. /.((?2)(?R)|\1|$)()/B
  13027. ------------------------------------------------------------------
  13028. Bra
  13029. Any
  13030. CBra 1
  13031. Recurse
  13032. Recurse
  13033. Alt
  13034. \1
  13035. Alt
  13036. $
  13037. Ket
  13038. CBra 2
  13039. Ket
  13040. Ket
  13041. End
  13042. ------------------------------------------------------------------
  13043. /.((?3)(?R)()(?2)|\1|$)()/B
  13044. ------------------------------------------------------------------
  13045. Bra
  13046. Any
  13047. CBra 1
  13048. Recurse
  13049. Recurse
  13050. CBra 2
  13051. Ket
  13052. Recurse
  13053. Alt
  13054. \1
  13055. Alt
  13056. $
  13057. Ket
  13058. CBra 3
  13059. Ket
  13060. Ket
  13061. End
  13062. ------------------------------------------------------------------
  13063. /(\9*+(?2);\3++()2|)++{/
  13064. Failed: error 115 at offset 2: reference to non-existent subpattern
  13065. /\V\x85\9*+((?2)\3++()2)*:2/
  13066. Failed: error 115 at offset 7: reference to non-existent subpattern
  13067. /(((?(R)){0,2}) (?'x'((?'R')((?'R')))))/dupnames
  13068. /(((?(X)){0,2}) (?'x'((?'X')((?'X')))))/dupnames
  13069. /(((?(R)){0,2}) (?'x'((?'X')((?'R')))))/
  13070. "(?J)(?'d'(?'d'\g{d}))"
  13071. "(?=!((?2)(?))({8(?<=(?1){29}8bbbb\x16\xd\xc6^($(\xa9H4){4}h}?1)B))\x15')"
  13072. Failed: error 125 at offset 16: lookbehind assertion is not fixed length
  13073. /A(?'')Z/
  13074. Failed: error 162 at offset 4: subpattern name expected
  13075. "(?J:(?|(?'R')(\k'R')|((?'R'))))"
  13076. /(?<=|(\,\$(?73591620449005828816)\xa8.{7}){6}\x09)/
  13077. Failed: error 161 at offset 17: subpattern number is too big
  13078. /^(?:(?(1)x|)+)+$()/B
  13079. ------------------------------------------------------------------
  13080. Bra
  13081. ^
  13082. SBra
  13083. SCond
  13084. 1 Cond ref
  13085. x
  13086. Alt
  13087. KetRmax
  13088. KetRmax
  13089. $
  13090. CBra 1
  13091. Ket
  13092. Ket
  13093. End
  13094. ------------------------------------------------------------------
  13095. /[[:>:]](?<)/
  13096. Failed: error 162 at offset 10: subpattern name expected
  13097. /((?x)(*:0))#(?'/
  13098. Failed: error 162 at offset 15: subpattern name expected
  13099. /(?C$[$)(?<]/
  13100. Failed: error 162 at offset 10: subpattern name expected
  13101. /(?C$)$)(?<]/
  13102. Failed: error 162 at offset 10: subpattern name expected
  13103. /(?(R))*+/B
  13104. ------------------------------------------------------------------
  13105. Bra
  13106. Braposzero
  13107. SBraPos
  13108. SCond
  13109. Cond recurse any
  13110. Ket
  13111. KetRpos
  13112. Ket
  13113. End
  13114. ------------------------------------------------------------------
  13115. abcd
  13116. 0:
  13117. /((?x)(?#))#(?'/
  13118. Failed: error 162 at offset 14: subpattern name expected
  13119. /((?x)(?#))#(?'abc')/I
  13120. Capture group count = 2
  13121. Named capture groups:
  13122. abc 2
  13123. First code unit = '#'
  13124. Subject length lower bound = 1
  13125. /[[:\\](?<[::]/
  13126. Failed: error 162 at offset 9: subpattern name expected
  13127. /[[:\\](?'abc')[a:]/I
  13128. Capture group count = 1
  13129. Named capture groups:
  13130. abc 1
  13131. Starting code units: : [ \
  13132. Subject length lower bound = 2
  13133. "[[[.\xe8Nq\xffq\xff\xe0\x2|||::Nq\xffq\xff\xe0\x6\x2|||::[[[:[::::::[[[[[::::::::[:[[[:[:::[[[[[[[[[[[[:::::::::::::::::[[.\xe8Nq\xffq\xff\xe0\x2|||::Nq\xffq\xff\xe0\x6\x2|||::[[[:[::::::[[[[[::::::::[:[[[:[:::[[[[[[[[[[[[[[:::E[[[:[:[[:[:::[[:::E[[[:[:[[:'[:::::E[[[:[::::::[[[:[[[[[[[::E[[[:[::::::[[[:[[[[[[[[:[[::[::::[[:::::::[[:[[[[[[[:[[::[:[[:[~"
  13134. Failed: error 106 at offset 353: missing terminating ] for character class
  13135. /()(?(R)0)*+/B
  13136. ------------------------------------------------------------------
  13137. Bra
  13138. CBra 1
  13139. Ket
  13140. Braposzero
  13141. SBraPos
  13142. SCond
  13143. Cond recurse any
  13144. 0
  13145. Ket
  13146. KetRpos
  13147. Ket
  13148. End
  13149. ------------------------------------------------------------------
  13150. /(?R-:(?</
  13151. Failed: error 158 at offset 3: (?R (recursive pattern call) must be followed by a closing parenthesis
  13152. /(?R-:(?<)/
  13153. Failed: error 158 at offset 3: (?R (recursive pattern call) must be followed by a closing parenthesis
  13154. /(?(?C{\Q})(?!(?'/
  13155. Failed: error 162 at offset 16: subpattern name expected
  13156. /(?(?C{\Q})(?!(?'abc')))/I
  13157. Capture group count = 1
  13158. Named capture groups:
  13159. abc 1
  13160. May match empty string
  13161. Subject length lower bound = 0
  13162. /(?1){3918}(((((0(\k'R'))))(?J)(?'R'(?'R'\3){99})))/I
  13163. Capture group count = 8
  13164. Max back reference = 8
  13165. Named capture groups:
  13166. R 7
  13167. R 8
  13168. Duplicate name status changes
  13169. Last code unit = '0'
  13170. Subject length lower bound = 65535
  13171. /(?|(aaa)|(b))\g{1}/I
  13172. Capture group count = 1
  13173. Max back reference = 1
  13174. Starting code units: a b
  13175. Subject length lower bound = 1
  13176. /(?|(aaa)|(b))(?1)/I
  13177. Capture group count = 1
  13178. Starting code units: a b
  13179. Subject length lower bound = 4
  13180. /(?|(aaa)|(b))/I
  13181. Capture group count = 1
  13182. Starting code units: a b
  13183. Subject length lower bound = 1
  13184. /(?|(?'a'aaa)|(?'a'b))\k'a'/I
  13185. Capture group count = 1
  13186. Max back reference = 1
  13187. Named capture groups:
  13188. a 1
  13189. Starting code units: a b
  13190. Subject length lower bound = 1
  13191. /(?|(?'a'aaa)|(?'a'b))(?'a'cccc)\k'a'/I,dupnames
  13192. Capture group count = 2
  13193. Max back reference = 2
  13194. Named capture groups:
  13195. a 1
  13196. a 2
  13197. Options: dupnames
  13198. Starting code units: a b
  13199. Last code unit = 'c'
  13200. Subject length lower bound = 5
  13201. /ab{3cd/
  13202. ab{3cd
  13203. 0: ab{3cd
  13204. /ab{3,cd/
  13205. ab{3,cd
  13206. 0: ab{3,cd
  13207. /ab{3,4a}cd/
  13208. ab{3,4a}cd
  13209. 0: ab{3,4a}cd
  13210. /{4,5a}bc/
  13211. {4,5a}bc
  13212. 0: {4,5a}bc
  13213. /\x0{ab}/
  13214. \0{ab}
  13215. 0: \x00{ab}
  13216. /^(a(b))\1\g1\g{1}\g-1\g{-1}\g{-02}Z/
  13217. ababababbbabZXXXX
  13218. 0: ababababbbabZ
  13219. 1: ab
  13220. 2: b
  13221. /.*?a(*PRUNE)b/
  13222. aab
  13223. 0: ab
  13224. /.*?a(*PRUNE)b/s
  13225. aab
  13226. 0: ab
  13227. /^a(*PRUNE)b/s
  13228. \= Expect no match
  13229. aab
  13230. No match
  13231. /.*?a(*SKIP)b/
  13232. aab
  13233. 0: ab
  13234. /(?(8000000000/
  13235. Failed: error 161 at offset 8: subpattern number is too big
  13236. /((?(R8000000000)))/
  13237. Failed: error 161 at offset 9: subpattern number is too big
  13238. /0(?0)|(1)(*THEN)(*SKIP:0)(*FAIL)/
  13239. \= Expect no match
  13240. 01
  13241. No match
  13242. /(?(1)()\983040\2)/
  13243. Failed: error 161 at offset 14: subpattern number is too big
  13244. /(*LIMIT_MATCH=)abc/
  13245. Failed: error 160 at offset 14: (*VERB) not recognized or malformed
  13246. /(*CRLF)(*LIMIT_MATCH=)abc/
  13247. Failed: error 160 at offset 21: (*VERB) not recognized or malformed
  13248. /(?:ab)?(?:ab)(?:ab)/
  13249. abab
  13250. 0: abab
  13251. ababab
  13252. 0: ababab
  13253. \= Expect no match
  13254. aba
  13255. No match
  13256. /((*MARK:A))++a(*SKIP:B)b/
  13257. \= Expect no match
  13258. aacb
  13259. No match
  13260. /(*MARK:a\zb)z/alt_verbnames
  13261. Failed: error 140 at offset 10: invalid escape sequence in (*VERB) name
  13262. /(*:ab\t(d\)c)xxx/
  13263. Failed: error 122 at offset 12: unmatched closing parenthesis
  13264. /(*:ab\t(d\)c)xxx/alt_verbnames,mark
  13265. cxxxz
  13266. 0: xxx
  13267. MK: ab\x09(d)c
  13268. /(*:A\Qxx)x\EB)x/alt_verbnames,mark
  13269. x
  13270. 0: x
  13271. MK: Axx)xB
  13272. /(*:A\ExxxB)x/alt_verbnames,mark
  13273. x
  13274. 0: x
  13275. MK: AxxxB
  13276. /(*: A \ and #comment
  13277. \ B)x/x,alt_verbnames,mark
  13278. x
  13279. 0: x
  13280. MK: A and B
  13281. /(*: A \ and #comment
  13282. \ B)x/alt_verbnames,mark
  13283. x
  13284. 0: x
  13285. MK: A and #comment\x0a B
  13286. /(*: A \ and #comment
  13287. \ B)x/x,mark
  13288. x
  13289. 0: x
  13290. MK: A \ and #comment\x0a \ B
  13291. /(*: A \ and #comment
  13292. \ B)x/mark
  13293. x
  13294. 0: x
  13295. MK: A \ and #comment\x0a \ B
  13296. /(*:A
  13297. B)x/alt_verbnames,mark
  13298. x
  13299. 0: x
  13300. MK: A\x0aB
  13301. /(*:abc\Qpqr)/alt_verbnames
  13302. Failed: error 160 at offset 12: (*VERB) not recognized or malformed
  13303. /abc/use_offset_limit
  13304. 1234abcde\=offset_limit=100
  13305. 0: abc
  13306. 1234abcde\=offset_limit=9
  13307. 0: abc
  13308. 1234abcde\=offset_limit=4
  13309. 0: abc
  13310. 1234abcde\=offset_limit=4,offset=4
  13311. 0: abc
  13312. \= Expect no match
  13313. 1234abcde\=offset_limit=4,offset=5
  13314. No match
  13315. 1234abcde\=offset_limit=3
  13316. No match
  13317. /(?<=abc)/use_offset_limit
  13318. 1234abc\=offset_limit=7
  13319. 0:
  13320. \= Expect no match
  13321. 1234abc\=offset_limit=6
  13322. No match
  13323. /A/g,replace=-,use_offset_limit
  13324. XAXAXAXAXA\=offset_limit=4
  13325. 2: X-X-XAXAXA
  13326. /abc/
  13327. \= Expect error
  13328. 1234abcde\=offset_limit=4
  13329. Failed: error -56: offset limit set without PCRE2_USE_OFFSET_LIMIT
  13330. /^\w/m,use_offset_limit
  13331. \n..\naa\=offset_limit=3
  13332. No match
  13333. \n..\naa\=offset_limit=4
  13334. 0: a
  13335. /abcd/null_context
  13336. abcd\=null_context
  13337. 0: abcd
  13338. \= Expect error - not allowed together
  13339. abcd\=null_context,find_limits
  13340. ** Not allowed together: find_limits null_context
  13341. abcd\=allusedtext,startchar
  13342. ** Not allowed together: allusedtext startchar
  13343. /abcd/replace=w\rx\x82y\o{333}z(\Q12\$34$$\x34\E5$$),substitute_extended
  13344. abcd
  13345. 1: w\x0dx\x82y\xdbz(12\$34$$\x345$)
  13346. /abcd/replace=w\rx\x82y\o{333}z(\Q12\$34$$\x34\E5$$),substitute_extended,substitute_literal
  13347. >>abcd<<
  13348. 1: >>w\rx\x82y\o{333}z(\Q12\$34$$\x34\E5$$)<<
  13349. /abcd/g,replace=\$1$2\,substitute_literal
  13350. XabcdYabcdZ
  13351. 2: X\$1$2\Y\$1$2\Z
  13352. /a(bc)(DE)/replace=a\u$1\U$1\E$1\l$2\L$2\Eab\Uab\LYZ\EDone,substitute_extended
  13353. abcDE
  13354. 1: aBcBCbcdEdeabAByzDone
  13355. /abcd/replace=xy\kz,substitute_extended
  13356. abcd
  13357. Failed: error -57 at offset 4 in replacement: bad escape sequence in replacement string
  13358. /a(?:(b)|(c))/substitute_extended,replace=X${1:+1:-1}X${2:+2:-2}
  13359. ab
  13360. 1: X1X-2
  13361. ac
  13362. 1: X-1X2
  13363. ab\=replace=${1:+$1\:$1:$2}
  13364. 1: b:b
  13365. ac\=replace=${1:+$1\:$1:$2}
  13366. 1: c
  13367. >>ac<<\=replace=${1:+$1\:$1:$2},substitute_literal
  13368. 1: >>${1:+$1\:$1:$2}<<
  13369. /a(?:(b)|(c))/substitute_extended,replace=X${1:-1:-1}X${2:-2:-2}
  13370. ab
  13371. 1: XbX2:-2
  13372. ac
  13373. 1: X1:-1Xc
  13374. /(a)/substitute_extended,replace=>${1:+\Q$1:{}$$\E+\U$1}<
  13375. a
  13376. 1: >$1:{}$$+A<
  13377. /X(b)Y/substitute_extended
  13378. XbY\=replace=x${1:+$1\U$1}y
  13379. 1: xbBY
  13380. XbY\=replace=\Ux${1:+$1$1}y
  13381. 1: XBBY
  13382. /a/substitute_extended,replace=${*MARK:+a:b}
  13383. a
  13384. Failed: error -58 at offset 7 in replacement: expected closing curly bracket in replacement string
  13385. /(abcd)/replace=${1:+xy\kz},substitute_extended
  13386. abcd
  13387. Failed: error -57 at offset 8 in replacement: bad escape sequence in replacement string
  13388. /(abcd)/
  13389. abcd\=replace=${1:+xy\kz},substitute_extended
  13390. Failed: error -57 at offset 8 in replacement: bad escape sequence in replacement string
  13391. /abcd/substitute_extended,replace=>$1<
  13392. abcd
  13393. Failed: error -49 at offset 3 in replacement: unknown substring
  13394. /abcd/substitute_extended,replace=>xxx${xyz}<<<
  13395. abcd
  13396. Failed: error -49 at offset 10 in replacement: unknown substring
  13397. /(?J)(?:(?<A>a)|(?<A>b))/replace=<$A>
  13398. [a]
  13399. 1: [<a>]
  13400. [b]
  13401. 1: [<b>]
  13402. \= Expect error
  13403. (a)\=ovector=1
  13404. Failed: error -54 at offset 3 in replacement: requested value is not available
  13405. /(a)|(b)/replace=<$1>
  13406. \= Expect error
  13407. b
  13408. Failed: error -55 at offset 3 in replacement: requested value is not set
  13409. /(aa)(BB)/substitute_extended,replace=\U$1\L$2\E$1..\U$1\l$2$1
  13410. aaBB
  13411. 1: AAbbaa..AAbBaa
  13412. /abcd/replace=wxyz,substitute_matched
  13413. abcd
  13414. 1: wxyz
  13415. pqrs
  13416. 0: pqrs
  13417. /abcd/g
  13418. >abcd1234abcd5678<\=replace=wxyz,substitute_matched
  13419. 2: >wxyz1234wxyz5678<
  13420. /^(o(\1{72}{\"{\\{00000059079}\d*){74}}){19}/I
  13421. Capture group count = 2
  13422. Max back reference = 1
  13423. Compile options: <none>
  13424. Overall options: anchored
  13425. First code unit = 'o'
  13426. Last code unit = '}'
  13427. Subject length lower bound = 65535
  13428. /((p(?'K/
  13429. Failed: error 142 at offset 7: syntax error in subpattern name (missing terminator?)
  13430. /((p(?'K/no_auto_capture
  13431. Failed: error 142 at offset 7: syntax error in subpattern name (missing terminator?)
  13432. /abc/replace=A$3123456789Z
  13433. abc
  13434. Failed: error -49 at offset 3 in replacement: unknown substring
  13435. /(?<!a{65535}a{5})x/I
  13436. Failed: error 187 at offset 0: lookbehind assertion is too long
  13437. /(?<!a{65535})x/I
  13438. Capture group count = 0
  13439. Max lookbehind = 65535
  13440. First code unit = 'x'
  13441. Subject length lower bound = 1
  13442. /(?=a\K)/replace=z,allow_lookaround_bsk
  13443. BaCaD
  13444. Failed: error -60: match with end before start or start moved backwards is not supported
  13445. /(?<=\K.)/g,replace=-,allow_lookaround_bsk
  13446. ab
  13447. Failed: error -60: match with end before start or start moved backwards is not supported
  13448. /(?'abcdefghijklmnopqrstuvwxyzABCDEFG'toolong)/
  13449. Failed: error 148 at offset 36: subpattern name is too long (maximum 32 code units)
  13450. /(?'abcdefghijklmnopqrstuvwxyzABCDEF'justright)/
  13451. # These two use zero-termination
  13452. /abcd/max_pattern_length=3
  13453. Failed: error 188 at offset 0: pattern string is longer than the limit set by the application
  13454. /abc/max_pattern_length=3
  13455. # These two, being hex, pass the length
  13456. /abcdefab/hex,max_pattern_length=3
  13457. Failed: error 188 at offset 0: pattern string is longer than the limit set by the application
  13458. /abcdef/hex,max_pattern_length=3
  13459. # These patterns used to take a long time to compile
  13460. "(.*)
  13461. ((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))
  13462. ((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))
  13463. ((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))"xI
  13464. Capture group count = 12
  13465. May match empty string
  13466. Options: extended
  13467. First code unit at start or follows newline
  13468. Subject length lower bound = 0
  13469. "(?<=a()
  13470. ((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))
  13471. ((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))
  13472. ((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))
  13473. a)"xI
  13474. Capture group count = 12
  13475. Max lookbehind = 2
  13476. May match empty string
  13477. Options: extended
  13478. Subject length lower bound = 0
  13479. "(?|()|())(.*)
  13480. ((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))
  13481. ((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))
  13482. ((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))"xI
  13483. Capture group count = 13
  13484. May match empty string
  13485. Options: extended
  13486. Subject length lower bound = 0
  13487. "(?|()|())(?<=a()
  13488. ((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))
  13489. ((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))
  13490. ((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))
  13491. a)"xI
  13492. Failed: error 135 at offset 9: lookbehind is too complicated
  13493. # Test the use of malloc for caching group information when there are more
  13494. # groups than fit into the on-stack workspace.
  13495. /\[()]{1024}/I,expand
  13496. Expanded: ()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()
  13497. Capture group count = 1024
  13498. May match empty string
  13499. Subject length lower bound = 0
  13500. # Test minlength capped at 65535
  13501. /(A{65000})\1{65000}/I
  13502. Capture group count = 1
  13503. Max back reference = 1
  13504. First code unit = 'A'
  13505. Last code unit = 'A'
  13506. Subject length lower bound = 65535
  13507. # Test group scans when numbers are not unique
  13508. /(?|()+|(a)+)/BI
  13509. ------------------------------------------------------------------
  13510. Bra
  13511. Bra
  13512. SCBra 1
  13513. KetRmax
  13514. Alt
  13515. CBra 1
  13516. a
  13517. KetRmax
  13518. Ket
  13519. Ket
  13520. End
  13521. ------------------------------------------------------------------
  13522. Capture group count = 1
  13523. May match empty string
  13524. Subject length lower bound = 0
  13525. /(?|(a)+|()+)/BI
  13526. ------------------------------------------------------------------
  13527. Bra
  13528. Bra
  13529. CBra 1
  13530. a
  13531. KetRmax
  13532. Alt
  13533. SCBra 1
  13534. KetRmax
  13535. Ket
  13536. Ket
  13537. End
  13538. ------------------------------------------------------------------
  13539. Capture group count = 1
  13540. May match empty string
  13541. Subject length lower bound = 0
  13542. /(?|()|(a))/BI
  13543. ------------------------------------------------------------------
  13544. Bra
  13545. Bra
  13546. CBra 1
  13547. Ket
  13548. Alt
  13549. CBra 1
  13550. a
  13551. Ket
  13552. Ket
  13553. Ket
  13554. End
  13555. ------------------------------------------------------------------
  13556. Capture group count = 1
  13557. May match empty string
  13558. Subject length lower bound = 0
  13559. /(?|(a)|())/BI
  13560. ------------------------------------------------------------------
  13561. Bra
  13562. Bra
  13563. CBra 1
  13564. a
  13565. Ket
  13566. Alt
  13567. CBra 1
  13568. Ket
  13569. Ket
  13570. Ket
  13571. End
  13572. ------------------------------------------------------------------
  13573. Capture group count = 1
  13574. May match empty string
  13575. Subject length lower bound = 0
  13576. # Test CRLF handling in empty string substitutions
  13577. /^$/gm,newline=anycrlf,replace=-
  13578. X\r\n\r\nY
  13579. 1: X\x0d\x0a-\x0d\x0aY
  13580. /^$/gm,newline=crlf,replace=-
  13581. X\r\n\r\nY
  13582. 1: X\x0d\x0a-\x0d\x0aY
  13583. /^$/gm,newline=any,replace=-
  13584. X\r\n\r\nY
  13585. 1: X\x0d\x0a-\x0d\x0aY
  13586. "(*ANYCRLF)(?m)^(.*[^0-9\r\n].*|)$"g,replace=NaN
  13587. 15\r\nfoo\r\n20\r\nbar\r\nbaz\r\n\r\n20
  13588. 4: 15\x0d\x0aNaN\x0d\x0a20\x0d\x0aNaN\x0d\x0aNaN\x0d\x0aNaN\x0d\x0a20
  13589. /a[[:punct:]b]/bincode
  13590. ------------------------------------------------------------------
  13591. Bra
  13592. a
  13593. [!-/:-@[-`b{-~]
  13594. Ket
  13595. End
  13596. ------------------------------------------------------------------
  13597. /a[b[:punct:]]/bincode
  13598. ------------------------------------------------------------------
  13599. Bra
  13600. a
  13601. [!-/:-@[-`b{-~]
  13602. Ket
  13603. End
  13604. ------------------------------------------------------------------
  13605. /L(?#(|++<!(2)?/B
  13606. ------------------------------------------------------------------
  13607. Bra
  13608. L?+
  13609. Ket
  13610. End
  13611. ------------------------------------------------------------------
  13612. /L(?#(|++<!(2)?/B,no_auto_possess
  13613. ------------------------------------------------------------------
  13614. Bra
  13615. L?
  13616. Ket
  13617. End
  13618. ------------------------------------------------------------------
  13619. /L(?#(|++<!(2)?/B,auto_callout
  13620. ------------------------------------------------------------------
  13621. Bra
  13622. Callout 255 0 14
  13623. L?+
  13624. Callout 255 14 0
  13625. Ket
  13626. End
  13627. ------------------------------------------------------------------
  13628. /L(?#(|++<!(2)?/B,no_auto_possess,auto_callout
  13629. ------------------------------------------------------------------
  13630. Bra
  13631. Callout 255 0 14
  13632. L?
  13633. Callout 255 14 0
  13634. Ket
  13635. End
  13636. ------------------------------------------------------------------
  13637. /(A*)\E+/B,auto_callout
  13638. ------------------------------------------------------------------
  13639. Bra
  13640. Callout 255 0 1
  13641. SCBra 1
  13642. Callout 255 1 2
  13643. A*
  13644. Callout 255 3 4
  13645. KetRmax
  13646. Callout 255 7 0
  13647. Ket
  13648. End
  13649. ------------------------------------------------------------------
  13650. /()\Q\E*]/B,auto_callout
  13651. ------------------------------------------------------------------
  13652. Bra
  13653. Callout 255 0 1
  13654. Brazero
  13655. SCBra 1
  13656. Callout 255 1 6
  13657. KetRmax
  13658. Callout 255 7 1
  13659. ]
  13660. Callout 255 8 0
  13661. Ket
  13662. End
  13663. ------------------------------------------------------------------
  13664. a[bc]d
  13665. --->a[bc]d
  13666. +0 ^ (
  13667. +1 ^ )\Q\E*
  13668. +7 ^ ]
  13669. +8 ^^ End of pattern
  13670. 0: ]
  13671. 1:
  13672. /\x8a+f|;T?(*:;.'?`(\xeap ){![^()!y*''C*(?';]{1;(\x08)/B,alt_verbnames,dupnames,extended
  13673. ------------------------------------------------------------------
  13674. Bra
  13675. \x{8a}++
  13676. f
  13677. Alt
  13678. ;
  13679. T?
  13680. *MARK ;.'?`(\x{ea}p
  13681. {!
  13682. [\x00- "-&+-:<->@-BD-xz-\xff] (neg)
  13683. {1;
  13684. CBra 1
  13685. \x08
  13686. Ket
  13687. Ket
  13688. End
  13689. ------------------------------------------------------------------
  13690. # Tests for NULL characters in comments and verb "names" and callouts
  13691. # /A#B\x00C\x0aZ/
  13692. /41 23 42 00 43 0a 5a/Bx,hex
  13693. ------------------------------------------------------------------
  13694. Bra
  13695. AZ
  13696. Ket
  13697. End
  13698. ------------------------------------------------------------------
  13699. # /A+#B\x00C\x0a+/
  13700. /41 2b 23 42 00 43 0a 2b/Bx,hex
  13701. ------------------------------------------------------------------
  13702. Bra
  13703. A++
  13704. Ket
  13705. End
  13706. ------------------------------------------------------------------
  13707. # /A(*:B\x00W#X\00Y\x0aC)Z/
  13708. /41 28 2a 3a 42 00 57 23 58 00 59 0a 43 29 5a/Bx,hex,alt_verbnames
  13709. ------------------------------------------------------------------
  13710. Bra
  13711. A
  13712. *MARK B\x{0}WC
  13713. Z
  13714. Ket
  13715. End
  13716. ------------------------------------------------------------------
  13717. # /A(*:B\x00W#X\00Y\x0aC)Z/
  13718. /41 28 2a 3a 42 00 57 23 58 00 59 0a 43 29 5a/Bx,hex
  13719. ------------------------------------------------------------------
  13720. Bra
  13721. A
  13722. *MARK B\x{0}W#X\x{0}Y\x{a}C
  13723. Z
  13724. Ket
  13725. End
  13726. ------------------------------------------------------------------
  13727. # /A(?C{X\x00Y})B/
  13728. /41 28 3f 43 7b 58 00 59 7d 29 42/B,hex
  13729. ------------------------------------------------------------------
  13730. Bra
  13731. A
  13732. CalloutStr {X\x{0}Y} 5 10 1
  13733. B
  13734. Ket
  13735. End
  13736. ------------------------------------------------------------------
  13737. # /A(?#X\x00Y)B/
  13738. /41 28 3f 23 7b 00 7d 29 42/B,hex
  13739. ------------------------------------------------------------------
  13740. Bra
  13741. AB
  13742. Ket
  13743. End
  13744. ------------------------------------------------------------------
  13745. # Tests for leading comment in extended patterns
  13746. / (?-x):?/extended
  13747. / (?-x):?/extended
  13748. /0b 28 3f 2d 78 29 3a/hex,extended
  13749. /#comment
  13750. (?-x):?/extended
  13751. /(8(*:6^\x09x\xa6l\)6!|\xd0:[^:|)\x09d\Z\d{85*m(?'(?<1!)*\W[*\xff]!!h\w]*\xbe;/alt_bsux,alt_verbnames,allow_empty_class,dollar_endonly,extended,multiline,never_utf,no_dotstar_anchor,no_start_optimize
  13752. Failed: error 162 at offset 49: subpattern name expected
  13753. /a|(b)c/replace=>$1<,substitute_unset_empty
  13754. cat
  13755. 1: c><t
  13756. xbcom
  13757. 1: x>b<om
  13758. /a|(b)c/
  13759. cat\=replace=>$1<
  13760. Failed: error -55 at offset 3 in replacement: requested value is not set
  13761. cat\=replace=>$1<,substitute_unset_empty
  13762. 1: c><t
  13763. xbcom\=replace=>$1<,substitute_unset_empty
  13764. 1: x>b<om
  13765. /a|(b)c/substitute_extended
  13766. cat\=replace=>${2:-xx}<
  13767. Failed: error -49 at offset 9 in replacement: unknown substring
  13768. cat\=replace=>${2:-xx}<,substitute_unknown_unset
  13769. 1: c>xx<t
  13770. cat\=replace=>${X:-xx}<,substitute_unknown_unset
  13771. 1: c>xx<t
  13772. /a|(?'X'b)c/replace=>$X<,substitute_unset_empty
  13773. cat
  13774. 1: c><t
  13775. xbcom
  13776. 1: x>b<om
  13777. /a|(?'X'b)c/replace=>$Y<,substitute_unset_empty
  13778. cat
  13779. Failed: error -49 at offset 3 in replacement: unknown substring
  13780. cat\=substitute_unknown_unset
  13781. 1: c><t
  13782. cat\=substitute_unknown_unset,-substitute_unset_empty
  13783. Failed: error -55 at offset 3 in replacement: requested value is not set
  13784. /a|(b)c/replace=>$2<,substitute_unset_empty
  13785. cat
  13786. Failed: error -49 at offset 3 in replacement: unknown substring
  13787. cat\=substitute_unknown_unset
  13788. 1: c><t
  13789. cat\=substitute_unknown_unset,-substitute_unset_empty
  13790. Failed: error -55 at offset 3 in replacement: requested value is not set
  13791. /()()()/use_offset_limit
  13792. \=ovector=11000000000
  13793. ** Invalid value in 'ovector=11000000000'
  13794. \=callout_fail=11000000000
  13795. ** Invalid value in 'callout_fail=11000000000'
  13796. \=callout_fail=1:11000000000
  13797. ** Invalid value in 'callout_fail=1:11000000000'
  13798. \=callout_data=11000000000
  13799. ** Invalid value in 'callout_data=11000000000'
  13800. \=callout_data=-11000000000
  13801. ** Invalid value in 'callout_data=-11000000000'
  13802. \=offset_limit=1100000000000000000000
  13803. ** Invalid value in 'offset_limit=1100000000000000000000'
  13804. \=copy=11000000000
  13805. ** Invalid value in 'copy=11000000000'
  13806. /(*MARK:A\x00b)/mark
  13807. abc
  13808. 0:
  13809. MK: A\x00b
  13810. /(*MARK:A\x00b)/mark,alt_verbnames
  13811. abc
  13812. 0:
  13813. MK: A\x00b
  13814. /"(*MARK:A" 00 "b)"/mark,hex
  13815. abc
  13816. 0:
  13817. MK: A\x00b
  13818. /"(*MARK:A" 00 "b)"/mark,hex,alt_verbnames
  13819. abc
  13820. 0:
  13821. MK: A\x00b
  13822. /efg/hex
  13823. ** Unexpected non-hex-digit 'g' at offset 2 in hex pattern: quote missing?
  13824. /eff/hex
  13825. ** Odd number of digits in hex pattern
  13826. /effg/hex
  13827. ** Unexpected non-hex-digit 'g' at offset 3 in hex pattern: quote missing?
  13828. /(?J)(?'a'))(?'a')/
  13829. Failed: error 122 at offset 10: unmatched closing parenthesis
  13830. /(?<=((?C)0))/
  13831. 9010
  13832. --->9010
  13833. 0 ^ 0
  13834. 0 ^ 0
  13835. 0:
  13836. 1: 0
  13837. \= Expect no match
  13838. abc
  13839. --->abc
  13840. 0 ^ 0
  13841. 0 ^ 0
  13842. 0 ^ 0
  13843. No match
  13844. /aaa/
  13845. \[abc]{10000000000000000000000000000}
  13846. ** Repeat count too large
  13847. \[a]{3}
  13848. 0: aaa
  13849. /\[AB]{6000000000000000000000}/expand
  13850. ** Pattern repeat count too large
  13851. # Hex uses pattern length, not zero-terminated. This tests for overrunning
  13852. # the given length of a pattern.
  13853. /'(*U'/hex
  13854. Failed: error 160 at offset 3: (*VERB) not recognized or malformed
  13855. /'(*'/hex
  13856. Failed: error 109 at offset 1: quantifier does not follow a repeatable item
  13857. /'('/hex
  13858. Failed: error 114 at offset 1: missing closing parenthesis
  13859. //hex
  13860. # These tests are here because Perl never allows a back reference in a
  13861. # lookbehind. PCRE2 supports some limited cases.
  13862. /([ab])...(?<=\1)z/
  13863. a11az
  13864. 0: a11az
  13865. 1: a
  13866. b11bz
  13867. 0: b11bz
  13868. 1: b
  13869. \= Expect no match
  13870. b11az
  13871. No match
  13872. /(?|([ab]))...(?<=\1)z/
  13873. Failed: error 125 at offset 13: lookbehind assertion is not fixed length
  13874. /([ab])(\1)...(?<=\2)z/
  13875. aa11az
  13876. 0: aa11az
  13877. 1: a
  13878. 2: a
  13879. /(a\2)(b\1)(?<=\2)/
  13880. Failed: error 125 at offset 10: lookbehind assertion is not fixed length
  13881. /(?<A>[ab])...(?<=\k'A')z/
  13882. a11az
  13883. 0: a11az
  13884. 1: a
  13885. b11bz
  13886. 0: b11bz
  13887. 1: b
  13888. \= Expect no match
  13889. b11az
  13890. No match
  13891. /(?<A>[ab])...(?<=\k'A')(?<A>)z/dupnames
  13892. Failed: error 125 at offset 13: lookbehind assertion is not fixed length
  13893. # Perl does not support \g+n
  13894. /((\g+1X)?([ab]))+/
  13895. aaXbbXa
  13896. 0: aaXbbXa
  13897. 1: bXa
  13898. 2: bX
  13899. 3: a
  13900. /ab(?C1)c/auto_callout
  13901. abc
  13902. --->abc
  13903. +0 ^ a
  13904. +1 ^^ b
  13905. 1 ^ ^ c
  13906. +8 ^ ^ End of pattern
  13907. 0: abc
  13908. /'ab(?C1)c'/hex,auto_callout
  13909. abc
  13910. --->abc
  13911. +0 ^ a
  13912. +1 ^^ b
  13913. 1 ^ ^ c
  13914. +8 ^ ^ End of pattern
  13915. 0: abc
  13916. # Perl accepts these, but gives a warning. We can't warn, so give an error.
  13917. /[a-[:digit:]]+/
  13918. Failed: error 150 at offset 4: invalid range in character class
  13919. a-a9-a
  13920. /[A-[:digit:]]+/
  13921. Failed: error 150 at offset 4: invalid range in character class
  13922. A-A9-A
  13923. /[a-\d]+/
  13924. Failed: error 150 at offset 5: invalid range in character class
  13925. a-a9-a
  13926. /(?<RA>abc)(?(R)xyz)/B
  13927. ------------------------------------------------------------------
  13928. Bra
  13929. CBra 1
  13930. abc
  13931. Ket
  13932. Cond
  13933. Cond recurse any
  13934. xyz
  13935. Ket
  13936. Ket
  13937. End
  13938. ------------------------------------------------------------------
  13939. /(?<R>abc)(?(R)xyz)/B
  13940. ------------------------------------------------------------------
  13941. Bra
  13942. CBra 1
  13943. abc
  13944. Ket
  13945. Cond
  13946. 1 Cond ref
  13947. xyz
  13948. Ket
  13949. Ket
  13950. End
  13951. ------------------------------------------------------------------
  13952. /(?=.*[A-Z])/I
  13953. Capture group count = 0
  13954. May match empty string
  13955. Subject length lower bound = 0
  13956. /()(?<=(?0))/
  13957. Failed: error 125 at offset 2: lookbehind assertion is not fixed length
  13958. /(?<!|!(?<!))/
  13959. /(?<!|!|!||||||(?<!)||(?<!)!|!||(?<!)!|!(?<!)!|!|!|!||||!!|<!)!|!||||!|/
  13960. /{2,2{2,2/use_length
  13961. /.>*?\g'0/use_length
  13962. Failed: error 157 at offset 6: \g is not followed by a braced, angle-bracketed, or quoted name/number or by a plain number
  13963. /.>*?\g'0/
  13964. Failed: error 157 at offset 6: \g is not followed by a braced, angle-bracketed, or quoted name/number or by a plain number
  13965. /{„Í„ÍÍ„Í{'{22{2{{2{'{22{{22{2{'{22{2{{2{{222{{2{'{22{2{22{2{'{22{2{{2{'{22{2{22{2{'{'{22{2{22{2{'{22{2{{2{'{22{2{22{2{'{222{2Ą̈́ÍÍ„Í{'{22{2{{2{'{22{{11{2{'{22{2{{2{{'{22{2{{2{'{22{{22{1{'{22{2{{2{{222{{2{'{22{2{22{2{'{/auto_callout
  13966. //
  13967. \=get=i00000000000000000000000000000000
  13968. ** Group name in 'get' is too long
  13969. \=get=i2345678901234567890123456789012,get=i1245678901234567890123456789012
  13970. ** Too many characters in named 'get' modifiers
  13971. "(?(?C))"
  13972. Failed: error 128 at offset 6: assertion expected after (?( or (?(?C)
  13973. /(?(?(?(?(?(?))))))/
  13974. Failed: error 128 at offset 2: assertion expected after (?( or (?(?C)
  13975. /(?<=(?1))((?s))/anchored
  13976. /(*:ab)*/
  13977. Failed: error 109 at offset 6: quantifier does not follow a repeatable item
  13978. %(*:(:(svvvvvvvvvv:]*[ Z!*;[]*[^[]*!^[+.+{{2,7}' _\\\\\\\\\\\\\)?.:.. *w////\\\Q\\\\\\\\\\\\\\\T\\\\\+/?/////'+\\\EEE?/////'+/*+/[^K]?]//(w)%never_backslash_c,alt_verbnames,auto_callout
  13979. /./newline=crlf
  13980. \=ph
  13981. No match
  13982. /(\x0e00\000000\xc)/replace=\P,substitute_extended
  13983. \x0e00\000000\xc
  13984. Failed: error -57 at offset 2 in replacement: bad escape sequence in replacement string
  13985. //replace=0
  13986. \=offset=7
  13987. Failed: error -33: bad offset value
  13988. /(?<=\G.)/g,replace=+
  13989. abc
  13990. 3: a+b+c+
  13991. ".+\QX\E+"B,no_auto_possess
  13992. ------------------------------------------------------------------
  13993. Bra
  13994. Any+
  13995. X+
  13996. Ket
  13997. End
  13998. ------------------------------------------------------------------
  13999. ".+\QX\E+"B,auto_callout,no_auto_possess
  14000. ------------------------------------------------------------------
  14001. Bra
  14002. Callout 255 0 4
  14003. Any+
  14004. Callout 255 4 4
  14005. X+
  14006. Callout 255 8 0
  14007. Ket
  14008. End
  14009. ------------------------------------------------------------------
  14010. # This one is here because Perl gives an 'unmatched )' error which goes away
  14011. # if one of the \) sequences is removed - which is weird. PCRE finds it too
  14012. # complicated to find a minimum matching length.
  14013. "()X|((((((((()))))))((((())))))\2())((((((\2\2)))\2)(\22((((\2\2)2))\2)))(2\ZZZ)+:)Z^|91ZiZZnter(ZZ |91Z(ZZ ZZ(\r2Z( or#(\Z2(Z\Z(\2\2)2))\2Z)Z(\22Z((\Z2(Z\Z(\2\2)2))\2Z+:)Z|91Z(ZZ ZZ(\r2Z( or#(\Z2(Z\Z((Z*(\2(Z\':))\0)i|||||||||||||||loZ\2\2)2))\2Z)Z(\22Z((\Z2(Z\Z(\2\2)2))\2Z)))int \)\0nte!rnal errpr\2\\21r(2\ZZZ)+:)Z!|91Z(ZZ ZZ(\r2Z( or#(\Z2(Z\Z(\2\2)2))\2Z)Z(\22Z((\Z2(Z\Z(\2\2)2))\2Z)))int \)\0(2\ZZZ)+:)Z^|91ZiZZnter(ZZ |91Z(ZZ ZZ(\r2Z( or#(\Z2(Z\Z(\2\2)2))\2Z)Z(\22Z((\Z2(Z\Z(\2\2)2))\2Z)))int \)\0(2\ZZZ)+:)Z^)))int \)\0(2\ZZZ)+:)Z^|91ZiZZnter(ZZernZal ZZ(\r2Z( or#(\Z2(Z\Z(\2\2)2))\2Z)Z(\22Z((\Z2(Z\Z(\2\2)2))\2Z)))int \))\ZZ(\r2Z( or#(\Z2(Z\Z(\2\2)2))\2Z)Z(\22Z((\Z2(Z\Z(\2\2)))\2))))((((((\2\2))))))"I
  14014. Capture group count = 108
  14015. Max back reference = 22
  14016. Contains explicit CR or LF match
  14017. Subject length lower bound = 1
  14018. # This checks that new code for handling groups that may match an empty string
  14019. # works on a very large number of alternatives. This pattern used to provoke a
  14020. # complaint that it was too complicated.
  14021. /(?:\[A|B|C|D|E|F|G|H|I|J|]{200}Z)/expand
  14022. # This one used to compile rubbish instead of a compile error, and then
  14023. # behave unpredictably at match time.
  14024. /.+(?(?C'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'))?!XXXX.=X/
  14025. Failed: error 128 at offset 63: assertion expected after (?( or (?(?C)
  14026. .+(?(?C'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'))?!XXXX.=X
  14027. /[:[:alnum:]-[[a:lnum:]+/
  14028. Failed: error 150 at offset 11: invalid range in character class
  14029. /((?(?C'')\QX\E(?!((?(?C'')(?!X=X));=)r*X=X));=)/
  14030. Failed: error 128 at offset 11: assertion expected after (?( or (?(?C)
  14031. /((?(?C'')\Q\E(?!((?(?C'')(?!X=X));=)r*X=X));=)/
  14032. /abcd/auto_callout
  14033. abcd\=callout_error=255:2
  14034. --->abcd
  14035. +0 ^ a
  14036. +1 ^^ b
  14037. Failed: error -37: callout error code
  14038. /()(\g+65534)/
  14039. Failed: error 161 at offset 11: subpattern number is too big
  14040. /()(\g+65533)/
  14041. Failed: error 115 at offset 10: reference to non-existent subpattern
  14042. /Á\x00\x00\x00š(\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\x00k\d+\x00‎\x00\x00\x00\x00\x00\2*\x00\x00\1*.){36}int^\x00\x00ÿÿ\x00š(\1{50779}?)J\w2/I
  14043. Capture group count = 2
  14044. Max back reference = 2
  14045. First code unit = \xc1
  14046. Last code unit = '2'
  14047. Subject length lower bound = 65535
  14048. /(a)(b)\2\1\1\1\1/I
  14049. Capture group count = 2
  14050. Max back reference = 2
  14051. First code unit = 'a'
  14052. Last code unit = 'b'
  14053. Subject length lower bound = 7
  14054. /(?<a>a)(?<b>b)\g{b}\g{a}\g{a}\g{a}\g{a}(?<a>xx)(?<b>zz)/I,dupnames
  14055. Capture group count = 4
  14056. Max back reference = 4
  14057. Named capture groups:
  14058. a 1
  14059. a 3
  14060. b 2
  14061. b 4
  14062. Options: dupnames
  14063. First code unit = 'a'
  14064. Last code unit = 'z'
  14065. Subject length lower bound = 11
  14066. //
  14067. \=ovector=7777777777
  14068. ** Invalid value in 'ovector=7777777777'
  14069. # This is here because Perl matches, even though a COMMIT is encountered
  14070. # outside of the recursion.
  14071. /(?1)(A(*COMMIT)|B)D/
  14072. BAXBAD
  14073. No match
  14074. "(?1){2}(a)"B
  14075. ------------------------------------------------------------------
  14076. Bra
  14077. Recurse
  14078. Recurse
  14079. CBra 1
  14080. a
  14081. Ket
  14082. Ket
  14083. End
  14084. ------------------------------------------------------------------
  14085. "(?1){2,4}(a)"B
  14086. ------------------------------------------------------------------
  14087. Bra
  14088. Recurse
  14089. Recurse
  14090. Brazero
  14091. Bra
  14092. Bra
  14093. Recurse
  14094. Ket
  14095. Brazero
  14096. Bra
  14097. Recurse
  14098. Ket
  14099. Ket
  14100. CBra 1
  14101. a
  14102. Ket
  14103. Ket
  14104. End
  14105. ------------------------------------------------------------------
  14106. # This test differs from Perl for the first subject. Perl ends up with
  14107. # $1 set to 'B'; PCRE2 has it unset (which I think is right).
  14108. /^(?:
  14109. (?:A| (?:B|B(*ACCEPT)) (?<=(.)) D)
  14110. (Z)
  14111. )+$/x
  14112. AZB
  14113. 0: AZB
  14114. 1: <unset>
  14115. 2: Z
  14116. AZBDZ
  14117. 0: AZBDZ
  14118. 1: B
  14119. 2: Z
  14120. # The first of these, when run by Perl, gives the mark 'aa', which is wrong.
  14121. '(?>a(*:aa))b|ac' mark
  14122. ac
  14123. 0: ac
  14124. '(?:a(*:aa))b|ac' mark
  14125. ac
  14126. 0: ac
  14127. /(R?){65}/
  14128. (R?){65}
  14129. 0:
  14130. 1:
  14131. /\[(a)]{60}/expand
  14132. aaaa
  14133. No match
  14134. /(?<!\1((?U)1((?U))))(*F)/never_backslash_c,alt_bsux,anchored,extended
  14135. /\g{3/
  14136. Failed: error 157 at offset 2: \g is not followed by a braced, angle-bracketed, or quoted name/number or by a plain number
  14137. /(a(?C1)(b)(c)d)+/
  14138. abcdabcd\=callout_capture
  14139. Callout 1: last capture = 0
  14140. --->abcdabcd
  14141. ^^ (
  14142. Callout 1: last capture = 1
  14143. 1: abcd
  14144. 2: b
  14145. 3: c
  14146. --->abcdabcd
  14147. ^ ^ (
  14148. 0: abcdabcd
  14149. 1: abcd
  14150. 2: b
  14151. 3: c
  14152. # Perl matches this one, but PCRE does not because (*ACCEPT) clears out any
  14153. # pending backtracks in the recursion.
  14154. /^ (?(DEFINE) (..(*ACCEPT)|...) ) (?1)$/x
  14155. \= Expect no match
  14156. abc
  14157. No match
  14158. # Perl gives no match for this one
  14159. /(a(*MARK:m)(*ACCEPT)){0}(?1)/mark
  14160. abc
  14161. 0: a
  14162. MK: m
  14163. /abc/endanchored
  14164. xyzabc
  14165. 0: abc
  14166. \= Expect no match
  14167. xyzabcdef
  14168. No match
  14169. \= Expect error
  14170. xyzabc\=ph
  14171. Failed: error -34: bad option value
  14172. /abc/
  14173. xyzabc\=endanchored
  14174. 0: abc
  14175. \= Expect no match
  14176. xyzabcdef\=endanchored
  14177. No match
  14178. \= Expect error
  14179. xyzabc\=ps,endanchored
  14180. Failed: error -34: bad option value
  14181. /abc(*ACCEPT)d/endanchored
  14182. xyzabc
  14183. 0: abc
  14184. \= Expect no match
  14185. xyzabcdef
  14186. No match
  14187. /abc|bcd/endanchored
  14188. xyzabcd
  14189. 0: bcd
  14190. \= Expect no match
  14191. xyzabcdef
  14192. No match
  14193. /a(*ACCEPT)x|aa/endanchored
  14194. aaa
  14195. 0: a
  14196. # Check auto-anchoring when there is a group that is never obeyed at
  14197. # the start of a branch.
  14198. /(?(DEFINE)(a))^bc/I
  14199. Capture group count = 1
  14200. Compile options: <none>
  14201. Overall options: anchored
  14202. First code unit = 'b'
  14203. Subject length lower bound = 2
  14204. /(a){0}.*bc/sI
  14205. Capture group count = 1
  14206. Compile options: dotall
  14207. Overall options: anchored dotall
  14208. Last code unit = 'c'
  14209. Subject length lower bound = 2
  14210. # This should be anchored, as the condition is always false and there is
  14211. # no alternative branch.
  14212. /(?(VERSION>=999)yes)^bc/I
  14213. Capture group count = 0
  14214. Compile options: <none>
  14215. Overall options: anchored
  14216. Subject length lower bound = 2
  14217. # This should not be anchored.
  14218. /(?(VERSION>=999)yes|no)^bc/I
  14219. Capture group count = 0
  14220. Last code unit = 'c'
  14221. Subject length lower bound = 4
  14222. /(*LIMIT_HEAP=0)xxx/I
  14223. Capture group count = 0
  14224. Heap limit = 0
  14225. First code unit = 'x'
  14226. Last code unit = 'x'
  14227. Subject length lower bound = 3
  14228. /\d{0,3}(*:abc)(?C1)xxx/callout_info
  14229. Callout 1 x
  14230. # ----------------------------------------------------------------------
  14231. # These are a whole pile of tests that touch lines of code that are not
  14232. # used by any other tests (at least when these were created).
  14233. /^a+?x/i,no_start_optimize,no_auto_possess
  14234. \= Expect no match
  14235. aaa
  14236. No match
  14237. /^[^a]{3,}?x/i,no_start_optimize,no_auto_possess
  14238. \= Expect no match
  14239. bbb
  14240. No match
  14241. cc
  14242. No match
  14243. /^X\S/no_start_optimize,no_auto_possess
  14244. \= Expect no match
  14245. X
  14246. No match
  14247. /^X\W/no_start_optimize,no_auto_possess
  14248. \= Expect no match
  14249. X
  14250. No match
  14251. /^X\H/no_start_optimize,no_auto_possess
  14252. \= Expect no match
  14253. X
  14254. No match
  14255. /^X\h/no_start_optimize,no_auto_possess
  14256. \= Expect no match
  14257. X
  14258. No match
  14259. /^X\V/no_start_optimize,no_auto_possess
  14260. \= Expect no match
  14261. X
  14262. No match
  14263. /^X\v/no_start_optimize,no_auto_possess
  14264. \= Expect no match
  14265. X
  14266. No match
  14267. /^X\h/no_start_optimize,no_auto_possess
  14268. \= Expect no match
  14269. XY
  14270. No match
  14271. /^X\V/no_start_optimize,no_auto_possess
  14272. \= Expect no match
  14273. X\n
  14274. No match
  14275. /^X\v/no_start_optimize,no_auto_possess
  14276. \= Expect no match
  14277. XX
  14278. No match
  14279. /^X.+?/s,no_start_optimize,no_auto_possess
  14280. \= Expect no match
  14281. X
  14282. No match
  14283. /^X\R+?/no_start_optimize,no_auto_possess
  14284. \= Expect no match
  14285. XX
  14286. No match
  14287. /^X\H+?/no_start_optimize,no_auto_possess
  14288. \= Expect no match
  14289. X
  14290. No match
  14291. /^X\h+?/no_start_optimize,no_auto_possess
  14292. \= Expect no match
  14293. X
  14294. No match
  14295. /^X\V+?/no_start_optimize,no_auto_possess
  14296. \= Expect no match
  14297. X
  14298. No match
  14299. X\n
  14300. No match
  14301. /^X\D+?/no_start_optimize,no_auto_possess
  14302. \= Expect no match
  14303. X
  14304. No match
  14305. X9
  14306. No match
  14307. /^X\S+?/no_start_optimize,no_auto_possess
  14308. \= Expect no match
  14309. X
  14310. No match
  14311. X\n
  14312. No match
  14313. /^X\W+?/no_start_optimize,no_auto_possess
  14314. \= Expect no match
  14315. X
  14316. No match
  14317. XX
  14318. No match
  14319. /^X.+?Z/no_start_optimize,no_auto_possess
  14320. \= Expect no match
  14321. XY\n
  14322. No match
  14323. /(*CRLF)^X.+?Z/no_start_optimize,no_auto_possess
  14324. \= Expect no match
  14325. XY\r\=ps
  14326. Partial match: XY\x0d
  14327. /^X\R+?Z/no_start_optimize,no_auto_possess
  14328. \= Expect no match
  14329. X\nX
  14330. No match
  14331. X\n\r\n
  14332. No match
  14333. X\n\rY
  14334. No match
  14335. X\n\nY
  14336. No match
  14337. X\n\x{0c}Y
  14338. No match
  14339. /(*BSR_ANYCRLF)^X\R+?Z/no_start_optimize,no_auto_possess
  14340. \= Expect no match
  14341. X\nX
  14342. No match
  14343. X\n\r\n
  14344. No match
  14345. X\n\rY
  14346. No match
  14347. X\n\nY
  14348. No match
  14349. X\n\x{0c}Y
  14350. No match
  14351. /^X\H+?Z/no_start_optimize,no_auto_possess
  14352. \= Expect no match
  14353. XY\t
  14354. No match
  14355. XYY
  14356. No match
  14357. /^X\h+?Z/no_start_optimize,no_auto_possess
  14358. \= Expect no match
  14359. X\t\t
  14360. No match
  14361. X\tY
  14362. No match
  14363. /^X\V+?Z/no_start_optimize,no_auto_possess
  14364. \= Expect no match
  14365. XY\n
  14366. No match
  14367. XYY
  14368. No match
  14369. /^X\v+?Z/no_start_optimize,no_auto_possess
  14370. \= Expect no match
  14371. X\n\n
  14372. No match
  14373. X\nY
  14374. No match
  14375. /^X\D+?Z/no_start_optimize,no_auto_possess
  14376. \= Expect no match
  14377. XY9
  14378. No match
  14379. XYY
  14380. No match
  14381. /^X\d+?Z/no_start_optimize,no_auto_possess
  14382. \= Expect no match
  14383. X99
  14384. No match
  14385. X9Y
  14386. No match
  14387. /^X\S+?Z/no_start_optimize,no_auto_possess
  14388. \= Expect no match
  14389. XY\n
  14390. No match
  14391. XYY
  14392. No match
  14393. /^X\s+?Z/no_start_optimize,no_auto_possess
  14394. \= Expect no match
  14395. X\n\n
  14396. No match
  14397. X\nY
  14398. No match
  14399. /^X\W+?Z/no_start_optimize,no_auto_possess
  14400. \= Expect no match
  14401. X.A
  14402. No match
  14403. X++
  14404. No match
  14405. /^X\w+?Z/no_start_optimize,no_auto_possess
  14406. \= Expect no match
  14407. Xa.
  14408. No match
  14409. Xaa
  14410. No match
  14411. /^X.{1,3}Z/s,no_start_optimize,no_auto_possess
  14412. \= Expect no match
  14413. Xa.bd
  14414. No match
  14415. /^X\h+Z/no_start_optimize,no_auto_possess
  14416. \= Expect no match
  14417. X\t\t
  14418. No match
  14419. X\tY
  14420. No match
  14421. /^X\V+Z/no_start_optimize,no_auto_possess
  14422. \= Expect no match
  14423. XY\n
  14424. No match
  14425. XYY
  14426. No match
  14427. /^(X(*THEN)Y|AB){0}(?1)/
  14428. ABX
  14429. 0: AB
  14430. \= Expect no match
  14431. XAB
  14432. No match
  14433. /^(?!A(?C1)B)C/
  14434. ABC\=callout_error=1,no_jit
  14435. No match
  14436. /^(?!A(?C1)B)C/no_start_optimize
  14437. ABC\=callout_error=1
  14438. --->ABC
  14439. 1 ^^ B
  14440. Failed: error -37: callout error code
  14441. /^(?(?!A(?C1)B)C)/
  14442. ABC\=callout_error=1
  14443. --->ABC
  14444. 1 ^^ B
  14445. Failed: error -37: callout error code
  14446. # ----------------------------------------------------------------------
  14447. /[a b c]/BxxI
  14448. ------------------------------------------------------------------
  14449. Bra
  14450. [a-c]
  14451. Ket
  14452. End
  14453. ------------------------------------------------------------------
  14454. Capture group count = 0
  14455. Options: extended_more
  14456. Starting code units: a b c
  14457. Subject length lower bound = 1
  14458. /[a b c]/BxxxI
  14459. ------------------------------------------------------------------
  14460. Bra
  14461. [a-c]
  14462. Ket
  14463. End
  14464. ------------------------------------------------------------------
  14465. Capture group count = 0
  14466. Options: extended extended_more
  14467. Starting code units: a b c
  14468. Subject length lower bound = 1
  14469. /[a b c]/B,extended_more
  14470. ------------------------------------------------------------------
  14471. Bra
  14472. [a-c]
  14473. Ket
  14474. End
  14475. ------------------------------------------------------------------
  14476. /[ a b c ]/B,extended_more
  14477. ------------------------------------------------------------------
  14478. Bra
  14479. [a-c]
  14480. Ket
  14481. End
  14482. ------------------------------------------------------------------
  14483. /[a b](?xx: [ 12 ] (?-xx:[ 34 ]) )y z/B
  14484. ------------------------------------------------------------------
  14485. Bra
  14486. [ ab]
  14487. Bra
  14488. [12]
  14489. Bra
  14490. [ 34]
  14491. Ket
  14492. Ket
  14493. y z
  14494. Ket
  14495. End
  14496. ------------------------------------------------------------------
  14497. # Unsetting /x also unsets /xx
  14498. /[a b](?xx: [ 12 ] (?-x:[ 34 ]) )y z/B
  14499. ------------------------------------------------------------------
  14500. Bra
  14501. [ ab]
  14502. Bra
  14503. [12]
  14504. Bra
  14505. [ 34]
  14506. Ket
  14507. Ket
  14508. y z
  14509. Ket
  14510. End
  14511. ------------------------------------------------------------------
  14512. /(a)(?-n:(b))(c)/nB
  14513. ------------------------------------------------------------------
  14514. Bra
  14515. Bra
  14516. a
  14517. Ket
  14518. Bra
  14519. CBra 1
  14520. b
  14521. Ket
  14522. Ket
  14523. Bra
  14524. c
  14525. Ket
  14526. Ket
  14527. End
  14528. ------------------------------------------------------------------
  14529. # ----------------------------------------------------------------------
  14530. # These test the dangerous PCRE2_EXTRA_BAD_ESCAPE_IS_LITERAL option.
  14531. /\j\x{z}\o{82}\L\uabcd\u\U\g{\g/B,\bad_escape_is_literal
  14532. ** Unrecognized modifier '\' in '\bad_escape_is_literal'
  14533. /\N{\c/IB,bad_escape_is_literal
  14534. ------------------------------------------------------------------
  14535. Bra
  14536. N{c
  14537. Ket
  14538. End
  14539. ------------------------------------------------------------------
  14540. Capture group count = 0
  14541. Extra options: bad_escape_is_literal
  14542. First code unit = 'N'
  14543. Last code unit = 'c'
  14544. Subject length lower bound = 3
  14545. /[\j\x{z}\o\gAb\g]/B,bad_escape_is_literal
  14546. ------------------------------------------------------------------
  14547. Bra
  14548. [Abgjoxz{}]
  14549. Ket
  14550. End
  14551. ------------------------------------------------------------------
  14552. /[Q-\N]/B,bad_escape_is_literal
  14553. Failed: error 150 at offset 5: invalid range in character class
  14554. /[\s-_]/bad_escape_is_literal
  14555. Failed: error 150 at offset 3: invalid range in character class
  14556. /[_-\s]/bad_escape_is_literal
  14557. Failed: error 150 at offset 5: invalid range in character class
  14558. /[\B\R\X]/B
  14559. Failed: error 107 at offset 2: escape sequence is invalid in character class
  14560. /[\B\R\X]/B,bad_escape_is_literal
  14561. Failed: error 107 at offset 2: escape sequence is invalid in character class
  14562. /[A-\BP-\RV-\X]/B
  14563. Failed: error 107 at offset 4: escape sequence is invalid in character class
  14564. /[A-\BP-\RV-\X]/B,bad_escape_is_literal
  14565. Failed: error 107 at offset 4: escape sequence is invalid in character class
  14566. # ----------------------------------------------------------------------
  14567. /a\b(c/literal
  14568. a\\b(c
  14569. 0: a\b(c
  14570. /a\b(c/literal,caseless
  14571. a\\b(c
  14572. 0: a\b(c
  14573. a\\B(c
  14574. 0: a\B(c
  14575. /a\b(c/literal,firstline
  14576. XYYa\\b(c
  14577. 0: a\b(c
  14578. \= Expect no match
  14579. X\na\\b(c
  14580. No match
  14581. /a\b?c/literal,use_offset_limit
  14582. XXXXa\\b?c\=offset_limit=4
  14583. 0: a\b?c
  14584. \= Expect no match
  14585. XXXXa\\b?c\=offset_limit=3
  14586. No match
  14587. /a\b(c/literal,anchored,endanchored
  14588. a\\b(c
  14589. 0: a\b(c
  14590. \= Expect no match
  14591. Xa\\b(c
  14592. No match
  14593. a\\b(cX
  14594. No match
  14595. Xa\\b(cX
  14596. No match
  14597. //literal,extended
  14598. Failed: error 192 at offset 0: invalid option bits with PCRE2_LITERAL
  14599. /a\b(c/literal,auto_callout,no_start_optimize
  14600. XXXXa\\b(c
  14601. --->XXXXa\b(c
  14602. +0 ^ a
  14603. +0 ^ a
  14604. +0 ^ a
  14605. +0 ^ a
  14606. +0 ^ a
  14607. +1 ^^ \
  14608. +2 ^ ^ b
  14609. +3 ^ ^ (
  14610. +4 ^ ^ c
  14611. +5 ^ ^ End of pattern
  14612. 0: a\b(c
  14613. /a\b(c/literal,auto_callout
  14614. XXXXa\\b(c
  14615. --->XXXXa\b(c
  14616. +0 ^ a
  14617. +1 ^^ \
  14618. +2 ^ ^ b
  14619. +3 ^ ^ (
  14620. +4 ^ ^ c
  14621. +5 ^ ^ End of pattern
  14622. 0: a\b(c
  14623. /(*CR)abc/literal
  14624. (*CR)abc
  14625. 0: (*CR)abc
  14626. /cat|dog/I,match_word
  14627. Capture group count = 0
  14628. Max lookbehind = 1
  14629. Extra options: match_word
  14630. Starting code units: c d
  14631. Subject length lower bound = 3
  14632. the cat sat
  14633. 0: cat
  14634. \= Expect no match
  14635. caterpillar
  14636. No match
  14637. snowcat
  14638. No match
  14639. syndicate
  14640. No match
  14641. /(cat)|dog/I,match_line,literal
  14642. Capture group count = 0
  14643. Compile options: literal
  14644. Overall options: anchored literal
  14645. Extra options: match_line
  14646. First code unit = '('
  14647. Subject length lower bound = 9
  14648. (cat)|dog
  14649. 0: (cat)|dog
  14650. \= Expect no match
  14651. the cat sat
  14652. No match
  14653. caterpillar
  14654. No match
  14655. snowcat
  14656. No match
  14657. syndicate
  14658. No match
  14659. /a whole line/match_line,multiline
  14660. Rhubarb \na whole line\n custard
  14661. 0: a whole line
  14662. \= Expect no match
  14663. Not a whole line
  14664. No match
  14665. # Perl gets this wrong, failing to capture 'b' in group 1.
  14666. /^(b+|a){1,2}?bc/
  14667. bbc
  14668. 0: bbc
  14669. 1: b
  14670. # And again here, for the "babc" subject string.
  14671. /^(b*|ba){1,2}?bc/
  14672. babc
  14673. 0: babc
  14674. 1: ba
  14675. bbabc
  14676. 0: bbabc
  14677. 1: ba
  14678. bababc
  14679. 0: bababc
  14680. 1: ba
  14681. \= Expect no match
  14682. bababbc
  14683. No match
  14684. babababc
  14685. No match
  14686. /[[:digit:]-a]/
  14687. Failed: error 150 at offset 10: invalid range in character class
  14688. /[[:digit:]-[:print:]]/
  14689. Failed: error 150 at offset 10: invalid range in character class
  14690. /[\d-a]/
  14691. Failed: error 150 at offset 3: invalid range in character class
  14692. /[\H-z]/
  14693. Failed: error 150 at offset 3: invalid range in character class
  14694. /[\d-[:print:]]/
  14695. Failed: error 150 at offset 3: invalid range in character class
  14696. # Perl gets the second of these wrong, giving no match.
  14697. "(?<=(a))\1?b"I
  14698. Capture group count = 1
  14699. Max back reference = 1
  14700. Max lookbehind = 1
  14701. Last code unit = 'b'
  14702. Subject length lower bound = 1
  14703. ab
  14704. 0: b
  14705. 1: a
  14706. aaab
  14707. 0: ab
  14708. 1: a
  14709. "(?=(a))\1?b"I
  14710. Capture group count = 1
  14711. Max back reference = 1
  14712. First code unit = 'a'
  14713. Last code unit = 'b'
  14714. Subject length lower bound = 2
  14715. ab
  14716. 0: ab
  14717. 1: a
  14718. aaab
  14719. 0: ab
  14720. 1: a
  14721. # JIT does not support callout_extra
  14722. /(*NO_JIT)(a+)b/auto_callout,no_start_optimize,no_auto_possess
  14723. \= Expect no match
  14724. aac\=callout_extra
  14725. New match attempt
  14726. --->aac
  14727. +9 ^ (
  14728. +10 ^ a+
  14729. +12 ^ ^ )
  14730. +13 ^ ^ b
  14731. Backtrack
  14732. --->aac
  14733. +12 ^^ )
  14734. +13 ^^ b
  14735. Backtrack
  14736. No other matching paths
  14737. New match attempt
  14738. --->aac
  14739. +9 ^ (
  14740. +10 ^ a+
  14741. +12 ^^ )
  14742. +13 ^^ b
  14743. Backtrack
  14744. No other matching paths
  14745. New match attempt
  14746. --->aac
  14747. +9 ^ (
  14748. +10 ^ a+
  14749. Backtrack
  14750. No other matching paths
  14751. New match attempt
  14752. --->aac
  14753. +9 ^ (
  14754. +10 ^ a+
  14755. No match
  14756. /(*NO_JIT)a+(?C'XXX')b/no_start_optimize,no_auto_possess
  14757. \= Expect no match
  14758. aac\=callout_extra
  14759. New match attempt
  14760. Callout (15): 'XXX'
  14761. --->aac
  14762. ^ ^ b
  14763. Backtrack
  14764. Callout (15): 'XXX'
  14765. --->aac
  14766. ^^ b
  14767. Backtrack
  14768. No other matching paths
  14769. New match attempt
  14770. Callout (15): 'XXX'
  14771. --->aac
  14772. ^^ b
  14773. No match
  14774. /\n/firstline
  14775. xyz\nabc
  14776. 0: \x0a
  14777. /\nabc/firstline
  14778. xyz\nabc
  14779. 0: \x0aabc
  14780. /\x{0a}abc/firstline,newline=crlf
  14781. \= Expect no match
  14782. xyz\r\nabc
  14783. No match
  14784. /[abc]/firstline
  14785. \= Expect no match
  14786. \na
  14787. No match
  14788. # These tests are matched in test 1 as they are Perl compatible. Here we are
  14789. # looking at what does and does not get auto-possessified.
  14790. /(?(DEFINE)(?<optional_a>a?))^(?&optional_a)a$/B
  14791. ------------------------------------------------------------------
  14792. Bra
  14793. Cond
  14794. Cond false
  14795. CBra 1
  14796. a?
  14797. Ket
  14798. Ket
  14799. ^
  14800. Recurse
  14801. a
  14802. $
  14803. Ket
  14804. End
  14805. ------------------------------------------------------------------
  14806. /(?(DEFINE)(?<optional_a>a?)X)^(?&optional_a)a$/B
  14807. ------------------------------------------------------------------
  14808. Bra
  14809. Cond
  14810. Cond false
  14811. CBra 1
  14812. a?
  14813. Ket
  14814. X
  14815. Ket
  14816. ^
  14817. Recurse
  14818. a
  14819. $
  14820. Ket
  14821. End
  14822. ------------------------------------------------------------------
  14823. /^(a?)b(?1)a/B
  14824. ------------------------------------------------------------------
  14825. Bra
  14826. ^
  14827. CBra 1
  14828. a?
  14829. Ket
  14830. b
  14831. Recurse
  14832. a
  14833. Ket
  14834. End
  14835. ------------------------------------------------------------------
  14836. /^(a?)+b(?1)a/B
  14837. ------------------------------------------------------------------
  14838. Bra
  14839. ^
  14840. SCBra 1
  14841. a?
  14842. KetRmax
  14843. b
  14844. Recurse
  14845. a
  14846. Ket
  14847. End
  14848. ------------------------------------------------------------------
  14849. /^(a?)++b(?1)a/B
  14850. ------------------------------------------------------------------
  14851. Bra
  14852. ^
  14853. SCBraPos 1
  14854. a?
  14855. KetRpos
  14856. b
  14857. Recurse
  14858. a
  14859. Ket
  14860. End
  14861. ------------------------------------------------------------------
  14862. /^(a?)+b/B
  14863. ------------------------------------------------------------------
  14864. Bra
  14865. ^
  14866. SCBra 1
  14867. a?
  14868. KetRmax
  14869. b
  14870. Ket
  14871. End
  14872. ------------------------------------------------------------------
  14873. /(?=a+)a(a+)++b/B
  14874. ------------------------------------------------------------------
  14875. Bra
  14876. Assert
  14877. a++
  14878. Ket
  14879. a
  14880. CBraPos 1
  14881. a++
  14882. KetRpos
  14883. b
  14884. Ket
  14885. End
  14886. ------------------------------------------------------------------
  14887. /(?<=(?=.){4,5}x)/B
  14888. ------------------------------------------------------------------
  14889. Bra
  14890. Assert back
  14891. Reverse
  14892. Assert
  14893. Any
  14894. Ket
  14895. Assert
  14896. Any
  14897. Ket
  14898. Assert
  14899. Any
  14900. Ket
  14901. Assert
  14902. Any
  14903. Ket
  14904. Brazero
  14905. Assert
  14906. Any
  14907. Ket
  14908. x
  14909. Ket
  14910. Ket
  14911. End
  14912. ------------------------------------------------------------------
  14913. # Perl behaves differently with these when optimization is turned off
  14914. /a(*PRUNE:X)bc|qq/mark,no_start_optimize
  14915. \= Expect no match
  14916. axy
  14917. No match, mark = X
  14918. /a(*THEN:X)bc|qq/mark,no_start_optimize
  14919. \= Expect no match
  14920. axy
  14921. No match, mark = X
  14922. /(?^x-i)AB/
  14923. Failed: error 194 at offset 4: invalid hyphen in option setting
  14924. /(?^-i)AB/
  14925. Failed: error 194 at offset 3: invalid hyphen in option setting
  14926. /(?x-i-i)/
  14927. Failed: error 194 at offset 5: invalid hyphen in option setting
  14928. /(?(?=^))b/I
  14929. Capture group count = 0
  14930. Last code unit = 'b'
  14931. Subject length lower bound = 1
  14932. abc
  14933. 0: b
  14934. /(?(?=^)|)b/I
  14935. Capture group count = 0
  14936. First code unit = 'b'
  14937. Subject length lower bound = 1
  14938. abc
  14939. 0: b
  14940. /(?(?=^)|^)b/I
  14941. Capture group count = 0
  14942. Compile options: <none>
  14943. Overall options: anchored
  14944. First code unit = 'b'
  14945. Subject length lower bound = 1
  14946. bbc
  14947. 0: b
  14948. \= Expect no match
  14949. abc
  14950. No match
  14951. /(?(1)^|^())/I
  14952. Capture group count = 1
  14953. Max back reference = 1
  14954. May match empty string
  14955. Compile options: <none>
  14956. Overall options: anchored
  14957. Subject length lower bound = 0
  14958. /(?(1)^())b/I
  14959. Capture group count = 1
  14960. Max back reference = 1
  14961. Last code unit = 'b'
  14962. Subject length lower bound = 1
  14963. /(?(1)^())+b/I,aftertext
  14964. Capture group count = 1
  14965. Max back reference = 1
  14966. Last code unit = 'b'
  14967. Subject length lower bound = 1
  14968. abc
  14969. 0: b
  14970. 0+ c
  14971. /(?(1)^()|^)+b/I,aftertext
  14972. Capture group count = 1
  14973. Max back reference = 1
  14974. Compile options: <none>
  14975. Overall options: anchored
  14976. First code unit = 'b'
  14977. Subject length lower bound = 1
  14978. bbc
  14979. 0: b
  14980. 0+ bc
  14981. \= Expect no match
  14982. abc
  14983. No match
  14984. /(?(1)^()|^)*b/I,aftertext
  14985. Capture group count = 1
  14986. Max back reference = 1
  14987. First code unit = 'b'
  14988. Subject length lower bound = 1
  14989. bbc
  14990. 0: b
  14991. 0+ bc
  14992. abc
  14993. 0: b
  14994. 0+ c
  14995. xbc
  14996. 0: b
  14997. 0+ c
  14998. /(?(1)^())+b/I,aftertext
  14999. Capture group count = 1
  15000. Max back reference = 1
  15001. Last code unit = 'b'
  15002. Subject length lower bound = 1
  15003. abc
  15004. 0: b
  15005. 0+ c
  15006. /(?(1)^a()|^a)+b/I,aftertext
  15007. Capture group count = 1
  15008. Max back reference = 1
  15009. Compile options: <none>
  15010. Overall options: anchored
  15011. First code unit = 'a'
  15012. Last code unit = 'b'
  15013. Subject length lower bound = 2
  15014. abc
  15015. 0: ab
  15016. 0+ c
  15017. \= Expect no match
  15018. bbc
  15019. No match
  15020. /(?(1)^|^(a))+b/I,aftertext
  15021. Capture group count = 1
  15022. Max back reference = 1
  15023. Compile options: <none>
  15024. Overall options: anchored
  15025. Last code unit = 'b'
  15026. Subject length lower bound = 1
  15027. abc
  15028. 0: ab
  15029. 0+ c
  15030. 1: a
  15031. \= Expect no match
  15032. bbc
  15033. No match
  15034. /(?(1)^a()|^a)*b/I,aftertext
  15035. Capture group count = 1
  15036. Max back reference = 1
  15037. Last code unit = 'b'
  15038. Subject length lower bound = 1
  15039. abc
  15040. 0: ab
  15041. 0+ c
  15042. bbc
  15043. 0: b
  15044. 0+ bc
  15045. xbc
  15046. 0: b
  15047. 0+ c
  15048. /a(b)c|xyz/g,allvector,replace=<$0>
  15049. abcdefabcpqr\=ovector=4
  15050. 2: <abc>def<abc>pqr
  15051. 0: 6 9
  15052. 1: 7 8
  15053. 2: <unchanged>
  15054. 3: <unchanged>
  15055. abxyz\=ovector=4
  15056. 1: ab<xyz>
  15057. 0: 2 5
  15058. 1: <unset>
  15059. 2: <unchanged>
  15060. 3: <unchanged>
  15061. abcdefxyz\=ovector=4
  15062. 2: <abc>def<xyz>
  15063. 0: 6 9
  15064. 1: <unset>
  15065. 2: <unchanged>
  15066. 3: <unchanged>
  15067. /a(b)c|xyz/allvector
  15068. abcdef\=ovector=4
  15069. 0: abc
  15070. 1: b
  15071. 2: <unchanged>
  15072. 3: <unchanged>
  15073. abxyz\=ovector=4
  15074. 0: xyz
  15075. 1: <unset>
  15076. 2: <unchanged>
  15077. 3: <unchanged>
  15078. /a(b)c|xyz/g,replace=<$0>,substitute_callout
  15079. abcdefabcpqr
  15080. 1(2) Old 0 3 "abc" New 0 5 "<abc>"
  15081. 2(2) Old 6 9 "abc" New 8 13 "<abc>"
  15082. 2: <abc>def<abc>pqr
  15083. abxyzpqrabcxyz
  15084. 1(1) Old 2 5 "xyz" New 2 7 "<xyz>"
  15085. 2(2) Old 8 11 "abc" New 10 15 "<abc>"
  15086. 3(1) Old 11 14 "xyz" New 15 20 "<xyz>"
  15087. 3: ab<xyz>pqr<abc><xyz>
  15088. 12abc34xyz99abc55\=substitute_stop=2
  15089. 1(2) Old 2 5 "abc" New 2 7 "<abc>"
  15090. 2(1) Old 7 10 "xyz" New 9 14 "<xyz> STOPPED"
  15091. 2: 12<abc>34xyz99abc55
  15092. 12abc34xyz99abc55\=substitute_skip=1
  15093. 1(2) Old 2 5 "abc" New 2 7 "<abc> SKIPPED"
  15094. 2(1) Old 7 10 "xyz" New 7 12 "<xyz>"
  15095. 3(2) Old 12 15 "abc" New 14 19 "<abc>"
  15096. 3: 12abc34<xyz>99<abc>55
  15097. 12abc34xyz99abc55\=substitute_skip=2
  15098. 1(2) Old 2 5 "abc" New 2 7 "<abc>"
  15099. 2(1) Old 7 10 "xyz" New 9 14 "<xyz> SKIPPED"
  15100. 3(2) Old 12 15 "abc" New 14 19 "<abc>"
  15101. 3: 12<abc>34xyz99<abc>55
  15102. /a(b)c|xyz/g,replace=<$0>
  15103. abcdefabcpqr
  15104. 2: <abc>def<abc>pqr
  15105. abxyzpqrabcxyz
  15106. 3: ab<xyz>pqr<abc><xyz>
  15107. 12abc34xyz\=substitute_stop=2
  15108. 1(2) Old 2 5 "abc" New 2 7 "<abc>"
  15109. 2(1) Old 7 10 "xyz" New 9 14 "<xyz> STOPPED"
  15110. 2: 12<abc>34xyz
  15111. 12abc34xyz\=substitute_skip=1
  15112. 1(2) Old 2 5 "abc" New 2 7 "<abc> SKIPPED"
  15113. 2(1) Old 7 10 "xyz" New 7 12 "<xyz>"
  15114. 2: 12abc34<xyz>
  15115. /a(b)c|xyz/replace=<$0>
  15116. abcdefabcpqr
  15117. 1: <abc>defabcpqr
  15118. 12abc34xyz\=substitute_skip=1
  15119. 1(2) Old 2 5 "abc" New 2 7 "<abc> SKIPPED"
  15120. 1: 12abc34xyz
  15121. 12abc34xyz\=substitute_stop=1
  15122. 1(2) Old 2 5 "abc" New 2 7 "<abc> STOPPED"
  15123. 1: 12abc34xyz
  15124. /abc\rdef/
  15125. abc\ndef
  15126. No match
  15127. /abc\rdef\x{0d}xyz/escaped_cr_is_lf
  15128. abc\ndef\rxyz
  15129. 0: abc\x0adef\x0dxyz
  15130. \= Expect no match
  15131. abc\ndef\nxyz
  15132. No match
  15133. /(?(*ACCEPT)xxx)/
  15134. Failed: error 128 at offset 2: assertion expected after (?( or (?(?C)
  15135. /(?(*atomic:xx)xxx)/
  15136. Failed: error 128 at offset 10: assertion expected after (?( or (?(?C)
  15137. /(?(*script_run:xxx)zzz)/
  15138. Failed: error 128 at offset 14: assertion expected after (?( or (?(?C)
  15139. /foobar/
  15140. the foobar thing\=copy_matched_subject
  15141. 0: foobar
  15142. the foobar thing\=copy_matched_subject,zero_terminate
  15143. 0: foobar
  15144. /foobar/g
  15145. the foobar thing foobar again\=copy_matched_subject
  15146. 0: foobar
  15147. 0: foobar
  15148. /(*:XX)^abc/I
  15149. Capture group count = 0
  15150. Compile options: <none>
  15151. Overall options: anchored
  15152. First code unit = 'a'
  15153. Subject length lower bound = 3
  15154. /(*COMMIT:XX)^abc/I
  15155. Capture group count = 0
  15156. Compile options: <none>
  15157. Overall options: anchored
  15158. First code unit = 'a'
  15159. Subject length lower bound = 3
  15160. /(*ACCEPT:XX)^abc/I
  15161. Capture group count = 0
  15162. May match empty string
  15163. Subject length lower bound = 0
  15164. /abc/replace=xyz
  15165. abc\=null_context
  15166. 1: xyz
  15167. /abc/replace=xyz,substitute_callout
  15168. abc
  15169. 1(1) Old 0 3 "abc" New 0 3 "xyz"
  15170. 1: xyz
  15171. \= Expect error message
  15172. abc\=null_context
  15173. ** Replacement callouts are not supported with null_context.
  15174. /\[()]{65535}()/expand
  15175. Failed: error 197 at offset 131071: too many capturing groups (maximum 65535)
  15176. /\[()]{65535}(?<A>)/expand
  15177. Failed: error 197 at offset 131075: too many capturing groups (maximum 65535)
  15178. /a(?:(*ACCEPT))??bc/
  15179. abc
  15180. 0: abc
  15181. axy
  15182. 0: a
  15183. /a(*ACCEPT)??bc/
  15184. abc
  15185. 0: abc
  15186. axy
  15187. 0: a
  15188. /a(*ACCEPT:XX)??bc/mark
  15189. abc
  15190. 0: abc
  15191. axy
  15192. 0: a
  15193. MK: XX
  15194. /(*:\)?/
  15195. Failed: error 109 at offset 5: quantifier does not follow a repeatable item
  15196. /(*:\Q \E){5}/alt_verbnames
  15197. Failed: error 109 at offset 11: quantifier does not follow a repeatable item
  15198. /(?=abc)/I
  15199. Capture group count = 0
  15200. May match empty string
  15201. First code unit = 'a'
  15202. Last code unit = 'c'
  15203. Subject length lower bound = 2
  15204. /(?|(X)|(XY))\1abc/I
  15205. Capture group count = 1
  15206. Max back reference = 1
  15207. First code unit = 'X'
  15208. Last code unit = 'c'
  15209. Subject length lower bound = 4
  15210. /(?|(a)|(bcde))(c)\2/I
  15211. Capture group count = 2
  15212. Max back reference = 2
  15213. Starting code units: a b
  15214. Last code unit = 'c'
  15215. Subject length lower bound = 3
  15216. /(?|(a)|(bcde))(c)\1/I
  15217. Capture group count = 2
  15218. Max back reference = 1
  15219. Starting code units: a b
  15220. Last code unit = 'c'
  15221. Subject length lower bound = 2
  15222. /(?|(?'A'a)|(?'A'bcde))(?'B'c)\k'B'(?'A')/I,dupnames
  15223. Capture group count = 3
  15224. Max back reference = 2
  15225. Named capture groups:
  15226. A 1
  15227. A 3
  15228. B 2
  15229. Options: dupnames
  15230. Starting code units: a b
  15231. Last code unit = 'c'
  15232. Subject length lower bound = 3
  15233. /(?|(?'A'a)|(?'A'bcde))(?'B'c)\k'A'(?'A')/I,dupnames
  15234. Capture group count = 3
  15235. Max back reference = 3
  15236. Named capture groups:
  15237. A 1
  15238. A 3
  15239. B 2
  15240. Options: dupnames
  15241. Starting code units: a b
  15242. Last code unit = 'c'
  15243. Subject length lower bound = 2
  15244. /((a|)+)+Z/I
  15245. Capture group count = 2
  15246. Starting code units: Z a
  15247. Last code unit = 'Z'
  15248. Subject length lower bound = 1
  15249. /((?=a))[abcd]/I
  15250. Capture group count = 1
  15251. First code unit = 'a'
  15252. Subject length lower bound = 1
  15253. /A(?:(*ACCEPT))?B/info
  15254. Capture group count = 0
  15255. First code unit = 'A'
  15256. Subject length lower bound = 1
  15257. /(A(*ACCEPT)??B)C/
  15258. ABC
  15259. 0: ABC
  15260. 1: AB
  15261. AXY
  15262. 0: A
  15263. 1: A
  15264. /(?<=(?<=a)b)c.*/I
  15265. Capture group count = 0
  15266. Max lookbehind = 1
  15267. First code unit = 'c'
  15268. Subject length lower bound = 1
  15269. abc\=ph
  15270. Partial match: c
  15271. \= Expect no match
  15272. xbc\=ph
  15273. No match
  15274. /(?<=ab)c.*/I
  15275. Capture group count = 0
  15276. Max lookbehind = 2
  15277. First code unit = 'c'
  15278. Subject length lower bound = 1
  15279. abc\=ph
  15280. Partial match: c
  15281. \= Expect no match
  15282. xbc\=ph
  15283. No match
  15284. /(?<=a(?<=a|a)c)/I
  15285. Capture group count = 0
  15286. Max lookbehind = 2
  15287. May match empty string
  15288. Subject length lower bound = 0
  15289. /(?<=a(?<=a|ba)c)/I
  15290. Capture group count = 0
  15291. Max lookbehind = 2
  15292. May match empty string
  15293. Subject length lower bound = 0
  15294. /(?<=(?<=a)b)(?<!abcd)/I
  15295. Capture group count = 0
  15296. Max lookbehind = 4
  15297. May match empty string
  15298. Subject length lower bound = 0
  15299. /(?<=(?<=a)b)(?<!abcd)(?<=(?<=a)bcde)/I
  15300. Capture group count = 0
  15301. Max lookbehind = 4
  15302. May match empty string
  15303. Subject length lower bound = 0
  15304. # Addition overflow
  15305. /( {32742} {42})(?<!\1{65481})/
  15306. Failed: error 187 at offset 15: lookbehind assertion is too long
  15307. # Multiplication overflow
  15308. /(X{65535})(?<=\1{32770})/
  15309. Failed: error 187 at offset 10: lookbehind assertion is too long
  15310. # ---- Non-atomic assertion tests ----
  15311. # Expect error: not allowed as a condition
  15312. /(?(*napla:xx)bc)/
  15313. Failed: error 198 at offset 9: atomic assertion expected after (?( or (?(?C)
  15314. /\A(*pla:.*\b(\w++))(?>.*?\b\1\b){3}/
  15315. word1 word3 word1 word2 word3 word2 word2 word1 word3 word4
  15316. No match
  15317. /\A(*napla:.*\b(\w++))(?>.*?\b\1\b){3}/
  15318. word1 word3 word1 word2 word3 word2 word2 word1 word3 word4
  15319. 0: word1 word3 word1 word2 word3 word2 word2 word1 word3
  15320. 1: word3
  15321. /\A(?*.*\b(\w++))(?>.*?\b\1\b){3}/
  15322. word1 word3 word1 word2 word3 word2 word2 word1 word3 word4
  15323. 0: word1 word3 word1 word2 word3 word2 word2 word1 word3
  15324. 1: word3
  15325. /(*plb:(.)..|(.)...)(\1|\2)/
  15326. abcdb\=offset=4
  15327. 0: b
  15328. 1: b
  15329. 2: <unset>
  15330. 3: b
  15331. abcda\=offset=4
  15332. No match
  15333. /(*naplb:(.)..|(.)...)(\1|\2)/
  15334. abcdb\=offset=4
  15335. 0: b
  15336. 1: b
  15337. 2: <unset>
  15338. 3: b
  15339. abcda\=offset=4
  15340. 0: a
  15341. 1: <unset>
  15342. 2: a
  15343. 3: a
  15344. /(?<*(.)..|(.)...)(\1|\2)/
  15345. abcdb\=offset=4
  15346. 0: b
  15347. 1: b
  15348. 2: <unset>
  15349. 3: b
  15350. abcda\=offset=4
  15351. 0: a
  15352. 1: <unset>
  15353. 2: a
  15354. 3: a
  15355. /(*non_atomic_positive_lookahead:ab)/B
  15356. ------------------------------------------------------------------
  15357. Bra
  15358. Non-atomic assert
  15359. ab
  15360. Ket
  15361. Ket
  15362. End
  15363. ------------------------------------------------------------------
  15364. /(*non_atomic_positive_lookbehind:ab)/B
  15365. ------------------------------------------------------------------
  15366. Bra
  15367. Non-atomic assert back
  15368. Reverse
  15369. ab
  15370. Ket
  15371. Ket
  15372. End
  15373. ------------------------------------------------------------------
  15374. /(*pla:ab+)/B
  15375. ------------------------------------------------------------------
  15376. Bra
  15377. Assert
  15378. a
  15379. b++
  15380. Ket
  15381. Ket
  15382. End
  15383. ------------------------------------------------------------------
  15384. /(*napla:ab+)/B
  15385. ------------------------------------------------------------------
  15386. Bra
  15387. Non-atomic assert
  15388. a
  15389. b+
  15390. Ket
  15391. Ket
  15392. End
  15393. ------------------------------------------------------------------
  15394. /(*napla:)+/
  15395. /(*naplb:)+/
  15396. /(*napla:^x|^y)/I
  15397. Capture group count = 0
  15398. May match empty string
  15399. Compile options: <none>
  15400. Overall options: anchored
  15401. Starting code units: x y
  15402. Subject length lower bound = 1
  15403. /(*napla:abc|abd)/I
  15404. Capture group count = 0
  15405. May match empty string
  15406. First code unit = 'a'
  15407. Subject length lower bound = 1
  15408. /(*napla:a|(.)(*ACCEPT)zz)\1../
  15409. abcd
  15410. 0: abc
  15411. 1: a
  15412. /(*napla:a(*ACCEPT)zz|(.))\1../
  15413. abcd
  15414. 0: bcd
  15415. 1: b
  15416. /(*napla:a|(*COMMIT)(.))\1\1/
  15417. aabc
  15418. 0: aa
  15419. 1: a
  15420. \= Expect no match
  15421. abbc
  15422. No match
  15423. /(*napla:a|(.))\1\1/
  15424. aabc
  15425. 0: aa
  15426. 1: a
  15427. abbc
  15428. 0: bb
  15429. 1: b
  15430. # ----
  15431. # Expect error (recursion => not fixed length)
  15432. /(\2)((?=(?<=\1)))/
  15433. Failed: error 125 at offset 8: lookbehind assertion is not fixed length
  15434. /c*+(?<=[bc])/
  15435. abc\=ph
  15436. Partial match: c
  15437. ab\=ph
  15438. Partial match:
  15439. abc\=ps
  15440. 0: c
  15441. ab\=ps
  15442. 0:
  15443. /c++(?<=[bc])/
  15444. abc\=ph
  15445. Partial match: c
  15446. ab\=ph
  15447. Partial match:
  15448. /(?<=(?=.(?<=x)))/
  15449. abx
  15450. 0:
  15451. ab\=ph
  15452. Partial match:
  15453. bxyz
  15454. 0:
  15455. xyz
  15456. 0:
  15457. /\z/
  15458. abc\=ph
  15459. Partial match:
  15460. abc\=ps
  15461. 0:
  15462. /\Z/
  15463. abc\=ph
  15464. Partial match:
  15465. abc\=ps
  15466. 0:
  15467. abc\n\=ph
  15468. Partial match: \x0a
  15469. abc\n\=ps
  15470. 0:
  15471. /(?![ab]).*/
  15472. ab\=ph
  15473. Partial match:
  15474. /c*+/
  15475. ab\=ph,offset=2
  15476. Partial match:
  15477. /\A\s*(a|(?:[^`]{28500}){4})/I
  15478. Capture group count = 1
  15479. Max lookbehind = 1
  15480. Compile options: <none>
  15481. Overall options: anchored
  15482. Subject length lower bound = 1
  15483. a
  15484. 0: a
  15485. 1: a
  15486. /\A\s*((?:[^`]{28500}){4})/I
  15487. Capture group count = 1
  15488. Max lookbehind = 1
  15489. Compile options: <none>
  15490. Overall options: anchored
  15491. Subject length lower bound = 65535
  15492. /\A\s*((?:[^`]{28500}){4}|a)/I
  15493. Capture group count = 1
  15494. Max lookbehind = 1
  15495. Compile options: <none>
  15496. Overall options: anchored
  15497. Subject length lower bound = 1
  15498. a
  15499. 0: a
  15500. 1: a
  15501. /(?<A>a)(?(<A>)b)((?<=b).*)/B
  15502. ------------------------------------------------------------------
  15503. Bra
  15504. CBra 1
  15505. a
  15506. Ket
  15507. Cond
  15508. 1 Cond ref
  15509. b
  15510. Ket
  15511. CBra 2
  15512. Assert back
  15513. Reverse
  15514. b
  15515. Ket
  15516. Any*+
  15517. Ket
  15518. Ket
  15519. End
  15520. ------------------------------------------------------------------
  15521. /(?(1)b)((?<=b).*)/B
  15522. ------------------------------------------------------------------
  15523. Bra
  15524. Cond
  15525. 1 Cond ref
  15526. b
  15527. Ket
  15528. CBra 1
  15529. Assert back
  15530. Reverse
  15531. b
  15532. Ket
  15533. Any*+
  15534. Ket
  15535. Ket
  15536. End
  15537. ------------------------------------------------------------------
  15538. /(?(R1)b)((?<=b).*)/B
  15539. ------------------------------------------------------------------
  15540. Bra
  15541. Cond
  15542. Cond recurse 1
  15543. b
  15544. Ket
  15545. CBra 1
  15546. Assert back
  15547. Reverse
  15548. b
  15549. Ket
  15550. Any*+
  15551. Ket
  15552. Ket
  15553. End
  15554. ------------------------------------------------------------------
  15555. /(?(DEFINE)b)((?<=b).*)/B
  15556. ------------------------------------------------------------------
  15557. Bra
  15558. Cond
  15559. Cond false
  15560. b
  15561. Ket
  15562. CBra 1
  15563. Assert back
  15564. Reverse
  15565. b
  15566. Ket
  15567. Any*+
  15568. Ket
  15569. Ket
  15570. End
  15571. ------------------------------------------------------------------
  15572. /(?(VERSION=10.4)b)((?<=b).*)/B
  15573. ------------------------------------------------------------------
  15574. Bra
  15575. Cond
  15576. Cond false
  15577. b
  15578. Ket
  15579. CBra 1
  15580. Assert back
  15581. Reverse
  15582. b
  15583. Ket
  15584. Any*+
  15585. Ket
  15586. Ket
  15587. End
  15588. ------------------------------------------------------------------
  15589. /[aA]b[cC]/IB
  15590. ------------------------------------------------------------------
  15591. Bra
  15592. /i a
  15593. b
  15594. /i c
  15595. Ket
  15596. End
  15597. ------------------------------------------------------------------
  15598. Capture group count = 0
  15599. First code unit = 'a' (caseless)
  15600. Last code unit = 'c' (caseless)
  15601. Subject length lower bound = 3
  15602. /[cc]abcd/I
  15603. Capture group count = 0
  15604. First code unit = 'c'
  15605. Last code unit = 'd'
  15606. Subject length lower bound = 5
  15607. /[Cc]abcd/I
  15608. Capture group count = 0
  15609. First code unit = 'C' (caseless)
  15610. Last code unit = 'd'
  15611. Subject length lower bound = 5
  15612. /[c]abcd/I
  15613. Capture group count = 0
  15614. First code unit = 'c'
  15615. Last code unit = 'd'
  15616. Subject length lower bound = 5
  15617. /(?:c|C)abcd/I
  15618. Capture group count = 0
  15619. First code unit = 'C' (caseless)
  15620. Last code unit = 'd'
  15621. Subject length lower bound = 5
  15622. /(a)?a/I
  15623. Capture group count = 1
  15624. Starting code units: a
  15625. Last code unit = 'a'
  15626. Subject length lower bound = 1
  15627. manm
  15628. 0: a
  15629. /^(?|(\*)(*napla:\S*_(\2?+.+))|(\w)(?=\S*_(\2?+\1)))+_\2$/
  15630. *abc_12345abc
  15631. 0: *abc_12345abc
  15632. 1: c
  15633. 2: 12345abc
  15634. /^(?|(\*)(*napla:\S*_(\3?+.+))|(\w)(?=\S*_((\2?+\1))))+_\2$/
  15635. *abc_12345abc
  15636. 0: *abc_12345abc
  15637. 1: c
  15638. 2: 12345abc
  15639. 3: 12345abc
  15640. /^((\1+)(?C)|\d)+133X$/
  15641. 111133X\=callout_capture
  15642. Callout 0: last capture = 2
  15643. 1: 1
  15644. 2: 111
  15645. --->111133X
  15646. ^ ^ |
  15647. Callout 0: last capture = 2
  15648. 1: 3
  15649. 2: 3
  15650. --->111133X
  15651. ^ ^ |
  15652. Callout 0: last capture = 2
  15653. 1: 1
  15654. 2: 11
  15655. --->111133X
  15656. ^ ^ |
  15657. Callout 0: last capture = 2
  15658. 1: 3
  15659. 2: 3
  15660. --->111133X
  15661. ^ ^ |
  15662. 0: 111133X
  15663. 1: 11
  15664. 2: 11
  15665. /abc/replace=xyz,substitute_replacement_only
  15666. 123abc456
  15667. 1: xyz
  15668. /a(?<ONE>b)c(?<TWO>d)e/g,replace=X$ONE+${TWO}Z,substitute_replacement_only
  15669. "abcde-abcde-"
  15670. 2: Xb+dZXb+dZ
  15671. /a(b)c|xyz/g,replace=<$0>,substitute_callout,substitute_replacement_only
  15672. abcdefabcpqr
  15673. 1(2) Old 0 3 "abc" New 0 5 "<abc>"
  15674. 2(2) Old 6 9 "abc" New 5 10 "<abc>"
  15675. 2: <abc><abc>
  15676. abxyzpqrabcxyz
  15677. 1(1) Old 2 5 "xyz" New 0 5 "<xyz>"
  15678. 2(2) Old 8 11 "abc" New 5 10 "<abc>"
  15679. 3(1) Old 11 14 "xyz" New 10 15 "<xyz>"
  15680. 3: <xyz><abc><xyz>
  15681. 12abc34xyz99abc55\=substitute_stop=2
  15682. 1(2) Old 2 5 "abc" New 0 5 "<abc>"
  15683. 2(1) Old 7 10 "xyz" New 5 10 "<xyz> STOPPED"
  15684. 2: <abc>
  15685. 12abc34xyz99abc55\=substitute_skip=1
  15686. 1(2) Old 2 5 "abc" New 0 5 "<abc> SKIPPED"
  15687. 2(1) Old 7 10 "xyz" New 0 5 "<xyz>"
  15688. 3(2) Old 12 15 "abc" New 5 10 "<abc>"
  15689. 3: <xyz><abc>
  15690. 12abc34xyz99abc55\=substitute_skip=2
  15691. 1(2) Old 2 5 "abc" New 0 5 "<abc>"
  15692. 2(1) Old 7 10 "xyz" New 5 10 "<xyz> SKIPPED"
  15693. 3(2) Old 12 15 "abc" New 5 10 "<abc>"
  15694. 3: <abc><abc>
  15695. /a(..)d/replace=>$1<,substitute_matched
  15696. xyzabcdxyzabcdxyz
  15697. 1: xyz>bc<xyzabcdxyz
  15698. xyzabcdxyzabcdxyz\=ovector=2
  15699. 1: xyz>bc<xyzabcdxyz
  15700. \= Expect error
  15701. xyzabcdxyzabcdxyz\=ovector=1
  15702. Failed: error -54 at offset 3 in replacement: requested value is not available
  15703. /a(..)d/g,replace=>$1<,substitute_matched
  15704. xyzabcdxyzabcdxyz
  15705. 2: xyz>bc<xyz>bc<xyz
  15706. xyzabcdxyzabcdxyz\=ovector=2
  15707. 2: xyz>bc<xyz>bc<xyz
  15708. \= Expect error
  15709. xyzabcdxyzabcdxyz\=ovector=1
  15710. Failed: error -54 at offset 3 in replacement: requested value is not available
  15711. xyzabcdxyzabcdxyz\=ovector=1,substitute_unset_empty
  15712. Failed: error -54 at offset 3 in replacement: requested value is not available
  15713. /55|a(..)d/g,replace=>$1<,substitute_matched
  15714. xyz55abcdxyzabcdxyz\=ovector=2,substitute_unset_empty
  15715. 3: xyz><>bc<xyz>bc<xyz
  15716. \= Expect error
  15717. xyz55abcdxyzabcdxyz\=ovector=2
  15718. Failed: error -55 at offset 3 in replacement: requested value is not set
  15719. /55|a(..)d/replace=>$1<,substitute_matched
  15720. xyz55abcdxyzabcdxyz\=ovector=2,substitute_unset_empty
  15721. 1: xyz><abcdxyzabcdxyz
  15722. /55|a(..)d/replace=>$1<
  15723. xyz55abcdxyzabcdxyz\=ovector=2,substitute_unset_empty
  15724. 1: xyz><abcdxyzabcdxyz
  15725. /55|a(..)d/g,replace=>$1<
  15726. xyz55abcdxyzabcdxyz\=ovector=2,substitute_unset_empty
  15727. 3: xyz><>bc<xyz>bc<xyz
  15728. /abc/replace=,caseless
  15729. XabcY
  15730. 0: abc
  15731. XABCY
  15732. 0: ABC
  15733. /abc/replace=[4],caseless
  15734. XabcY
  15735. 1: XY
  15736. XABCY
  15737. 1: XY
  15738. /abc/replace=*,caseless
  15739. XabcY
  15740. 1: X*Y
  15741. XABCY
  15742. 1: X*Y
  15743. XabcY\=replace=
  15744. 0: abc
  15745. # Expect non-fixed-length error
  15746. "(?<=X(?(DEFINE)(.*))(?1))."
  15747. Failed: error 125 at offset 0: lookbehind assertion is not fixed length
  15748. /\sxxx\s/tables=1
  15749. \= Expect no match
  15750. AB\x{85}xxx\x{a0}XYZ
  15751. No match
  15752. /\sxxx\s/tables=2
  15753. AB\x{85}xxx\x{a0}XYZ
  15754. 0: \x85xxx\xa0
  15755. /^\w+/tables=2
  15756. École
  15757. 0: \xc3
  15758. /^\w+/tables=3
  15759. ** 'Tables = 3' is invalid: binary tables have not been loaded
  15760. École
  15761. #loadtables ./testbtables
  15762. /^\w+/tables=3
  15763. École
  15764. 0: \xc3
  15765. /"(*MARK:>" 00 "<).."/hex,mark,no_start_optimize
  15766. AB
  15767. 0: AB
  15768. MK: >\x00<
  15769. A\=ph
  15770. Partial match, mark=>\x00<: A
  15771. \= Expect no match
  15772. A
  15773. No match, mark = >\x00<
  15774. /"(*MARK:>" 00 "<).(?C1)."/hex,mark,no_start_optimize
  15775. AB
  15776. --->AB
  15777. 1 ^^ .
  15778. Latest Mark: >\x00<
  15779. 0: AB
  15780. MK: >\x00<
  15781. /(?(VERSION=0.0/
  15782. Failed: error 179 at offset 14: syntax error or number too big in (?(VERSION condition
  15783. # Perl has made \K in lookarounds an error. PCRE2 now rejects as well, unless
  15784. # explicitly authorized.
  15785. /(?=a\Kb)ab/
  15786. Failed: error 199 at offset 10: \K is not allowed in lookarounds (but see PCRE2_EXTRA_ALLOW_LOOKAROUND_BSK)
  15787. /(?=a\Kb)ab/allow_lookaround_bsk
  15788. ab
  15789. 0: b
  15790. /(?!a\Kb)ac/
  15791. Failed: error 199 at offset 10: \K is not allowed in lookarounds (but see PCRE2_EXTRA_ALLOW_LOOKAROUND_BSK)
  15792. /(?!a\Kb)ac/allow_lookaround_bsk
  15793. ac
  15794. 0: ac
  15795. /^abc(?<=b\Kc)d/
  15796. Failed: error 199 at offset 14: \K is not allowed in lookarounds (but see PCRE2_EXTRA_ALLOW_LOOKAROUND_BSK)
  15797. /^abc(?<=b\Kc)d/allow_lookaround_bsk
  15798. abcd
  15799. 0: cd
  15800. /^abc(?<!b\Kq)d/
  15801. Failed: error 199 at offset 14: \K is not allowed in lookarounds (but see PCRE2_EXTRA_ALLOW_LOOKAROUND_BSK)
  15802. /^abc(?<!b\Kq)d/,allow_lookaround_bsk
  15803. abcd
  15804. 0: abcd
  15805. # ---------
  15806. # End of testinput2
  15807. Error -70: PCRE2_ERROR_BADDATA (unknown error number)
  15808. Error -62: bad serialized data
  15809. Error -2: partial match
  15810. Error -1: no match
  15811. Error 0: PCRE2_ERROR_BADDATA (unknown error number)
  15812. Error 100: no error
  15813. Error 101: \ at end of pattern
  15814. Error 191: PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES is not allowed in UTF-16 mode
  15815. Error 200: PCRE2_ERROR_BADDATA (unknown error number)