Online Regex tester and visualizer - ExtendsClass

文章推薦指數: 80 %
投票人數:10人

CyrilEx is an online regex debugger, it allows you to test regular expression in PHP (PCRE), Python, Ruby, JavaScript, Java and MySQL. It helps you to test ... ItwouldbenicetodisableadBlock,advertisingistheonlyresourceofthiswebsite:) Regularexpressiontotest//gFlagsglobalsearch(g)Findsallthecorrespondencesratherthanstoppingafterthefirstmatchcaseinsensitive(i)Caseisignoredmultiline(m)Startandendcharacters(^and$)aretreatedasworkingoneachlineunicode(u)TreattheregularexpressionasasequenceofUnicodecodepointssticky(y)MatchesonlyfromtheindexindicatedbythelastIndexpropertyofthisregularexpressiondotallmake.matchnewlinetoo.(s)Dotmetacharactermatchesallcharacters,includingnewlinesglobalsearch(g)Findsallthecorrespondencesratherthanstoppingafterthefirstmatchcaseinsensitive(i)Caseisignoredmultiline(m)Startandendcharacters(^and$)aretreatedasworkingoneachlineunicode(u)TreattheregularexpressionasasequenceofUnicodecodepointsdotallmake.matchnewlinetoo.(s)Dotmetacharactermatchesallcharacters,includingnewlinescomment(x)Ignorewhitespaceinregexanchored(A)Forcedtobe"anchored",thatis,itisconstrainedtomatchonlyatthestartofthestringwhichisbeingsearcheddollarendonly(D)Dollarmetacharactermatchesonlyattheendofthesubjectstringextraanalysis(S)Extraanalysisisperformedungreedy(U)Invertsthe"greediness"ofthequantifierssothattheyarenotgreedybydefault,butbecomegreedyiffollowedby?(NotcompatiblewithPerl)extra(X)TurnsonadditionalfunctionalityofPCREthatisincompatiblewithPerljchanged(J)Allowduplicatenamesforsubpatternsglobalsearch(g)FindsallthecorrespondencesratherthanstoppingafterthefirstmatchIGNORECASE(i)CaseisignoredMULTILINE(m)Startandendcharacters(^and$)aretreatedasworkingoneachlineLOCALE(l)Make\w,\W,\b,\Bandcase-insensitivematchingdependentonthecurrentlocale.UNICODE(u)TreattheregularexpressionasasequenceofUnicodecodepointsDOTALLmake.matchnewlinetoo.(s)Dotmetacharactermatchesallcharacters,includingnewlinesVERBOSE(x)Ignorewhitespaceinregexglobalsearch(g)FindsallthecorrespondencesratherthanstoppingafterthefirstmatchIGNORECASE(i)CaseisignoredMULTILINE(m)Startandendcharacters(^and$)aretreatedasworkingoneachlineEXTENDED(x)Ignorewhitespaceinregexglobalsearch(g)FindsallthecorrespondencesratherthanstoppingafterthefirstmatchCASE_INSENSITIVE(i)Enablescase-insensitivematching.COMMENTS(x)Permitswhitespaceandcommentsinpattern.DOTALL(s)Enablesdotallmode.MULTILINE(m)Enablesmultilinemode.UNICODE_CASE(u)EnablesUnicode-awarecasefolding.UNIX_LINES(l)EnablesUnixlinesmode.CANON_EQ(c)Enablescanonicalequivalence.LITERAL(L)Enablesliteralparsingofthepattern.UNICODE_CHARACTER_CLASS(C)EnablestheUnicodeversionofPredefinedcharacterclassesandPOSIXcharacterclasses..globalsearch(g)FindsallthecorrespondencesratherthanstoppingafterthefirstmatchCase-sensitivematching(c).Caseisignored(i)Multiple-linemode(m)Recognizelineterminatorswithinthestring.Thedefaultbehavioristomatchlineterminatorsonlyatthestartandendofthestringexpression.The.charactermatcheslineterminators(n)The.charactermatcheslineterminatorsUnix-onlylineendings(u)Onlythenewlinecharacterisrecognizedasalineendingbythe.,^,and$matchoperators.StringtotestGenerateastringfromRegEx(Beta)ExplanationSubstitutionRegExEngineSave&ShareQuickStartJavaScriptPython(3.4)Ruby(2.1)Java(JDK14)PHP(7)MySQL8.0(beta)Savethisregularexpressioninordertoshareit.SaveUpdateDeleteForkBecareful,thedatawillbeaccessibletoeveryone,pleasedonotsavesensitivedata.Anchors$Endofstringorendofline(inmulti-linepattern)^Startofstringorstartofline(inmulti-linepattern)\bWordboundary\BNotwordboundaryQuantifiersx?0or1x+1ormore*0ormore{2}Exactly2{2,}2ormore{2,5}Between2and5Metacharacters.Anysinglecharacterexceptlinebreak(\n,\r)\wWordcharacter\WNon-wordcharacter\dDigit\DNon-digitcharacter\sWhitespacecharacter([\f\n\r\t\v\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff])\SNon-whitespacecharacter\bBeginning/endofaword\BNotatthebeginning/endofaword\nNewlinecharacter\rCarriagereturncharacter\tTabcharacter\vVerticaltabcharacter\0NULcharacter\fFormfeedcharacter\xxxCharacterspecifiedbyanoctalnumberxxx\xddCharacterspecifiedbyanhexadecimalnumberdd\uddddUnicodecharacterspecifiedbyanhexadecimalnumberddddBrackets[xyz]Anycharacterbetweenthebrackets[^xyz]Anycharacternotbetweenthebrackets[x-z]Anycharacterfromxtoz[^x-z]NOT(Anycharacterfromxtoz)(x|y)Anyofthealternativesspecified CyrilExisanonlineregexdebugger,itallowsyoutotestregularexpressioninPHP(PCRE),Python,Ruby,JavaScript,JavaandMySQL.Ithelpsyoutotestanddebugregexonline,youcanvisualizethematcheswhenmatchingastringagainstaregex.Aregexvisualizerallowstovisualizeyourregex,ithelpstounderstandit.Thisfeatureisusefulforlargeregexes.CyrilexalsoallowsyoutogenerateastringexamplefromaRegEx.Thisgivesaprettyquickideaofaregex.YoucanconsulttheregexQuickStartorseethefulluserguidetohelpyoutousethisregularexpressiontester.UserguideStep0:Choosetheregexengine:JavaScript,Ruby,JavaorPCRE(PHP,Python).Step1:Copyandpasteordirectlytypeyourregularexpressiontotestinthe"Regularexpressiontotest"field.Step2:Selecttheflagsyouwantin"Flags"section.Step3:Copyandpasteordirectlytypeyourteststringinthe"teststring"field.Assoonasyoumakeamodification(regularexpression,flagsorteststring):Step4:Anexplanationisgeneratedaboutofyourregex.Itusesregulex,itisaJavaScriptRegularExpressionParser&Visualizer(WritteninpureJavaScript).Step5:AmessageindicatesthenumberofcorrespondenceYourregexishighlightedaccordingtothesyntax.Itisabetaversion,itcanbewrong.Youcanalsoreplaceregularexpressionmatchesintextwithareplacementstring.Step6:Copyandpasteordirectlytypeyoursubstitutestringinthe"Substitution"field.Step7:Substitutionsareautomaticallyperformedonyourteststring.Youcansaveyourregexinordertoshareit.Youcanprotectyoursharewithapassword,soonlyyoucanchangeit.See"SaveandShare"section:GenerateastringfromRegEx(Beta):Clickson"GenerateastringfromRegEx(Beta)"inordertogenerateastringthatmatcheswiththeregex.Substitutionsarenotmanaged.News:YoucannowtestMySQLregex,selectthe"MySQL8"engine.AboutregularexpressionAregularexpressionisasequenceofcharactersthatdefineasearchpattern.Thispatternisusedbystringsearchingalgorithmsforfindorreplacetext.ItcanbeusefultovalidateanEMAILaddressoranIPaddress.Regexsupportispartofthestandardlibraryofmanyprogramminglanguages.Eachprogramminglanguagehasitsownregexengine,regularexpressionimplementationsvaryslightlybetweenlanguages.Regexhumor(JamieZawinski):Somepeople,whenconfrontedwithaproblem,think"Iknow,I'lluseregularexpressions."Nowtheyhavetwoproblems.RegexcheckerCyrilexisanonlineregexchecker,itallowstoeasilytestanddebugregex.Thisavoidswastingtimewritingthefewlinesofcodeneededtodothetests.Aregexvisualizerandaregexgeneratorhelpyoutounderstandanddebugyourregexes.Thistoolalsoallowsyoutoshareyourregularexpressions,thiscanbeusefulwhenyouwanttoexplainoneofyourregexproblems(oritsresolution)onaforum.TheunavoidablesSomeregexthatcanbeuseful(withoutwarranty).EmailaddressThelastRFCiscomplex,thereisnoreliablesolution,thisregexshouldworkmorethan99%ofthetime(Youmustturnoffcasesensitivity).^((?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\]))$AlphanumericTheregexbelowallowstovalidatealphanumericstring.Becareful,\wauthorizestheunderscorecharacter.^[a-zA-Z0-9]+$MD5TheregexbelowallowstovalidateMD5string.^[a-f0-9]{32}$IPV4TheregexbelowallowstovalidateIPv4.^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$×SaveregularexpressionYourregexhasbeenpermanentlysavedandyou(oranybody)canaccesswiththislink:×PasswordChoiceapasswordtomodify/deletethisregexlaterEnterpasswordtomodifythisregex.Enterpasswordtodeletethisregex.Enterthenewpasswordforthefork.ActionYoucanreportabugorgivefeedbackbyaddingacomment(below)orbyclicking"Contactme"link(atthetoprighthandcornerofthepage).CommentsCaptchaEnterthecode(caseinsensitive)*Ifyoucannotreadthecode,clickheretogenerateanewcodeDietmarSchindler-2020-03-1014:23Iftheexpressionisn'tunderstoodbytheengine,theerrormessageisvisibletooshortly.AlsoitwouldbeimportanttoknowwhichPythonversionisusedforthePythonRegExengine(itseemstonotunderstand"(?i:…)").Example:\b(([A-Z])([A-Z])?([A-Z])?([A-Z])?)(?:\w+){,1}\(?from.*?(?P\2.*?(?i:\3?.*?\4?.*?\5?).*?)\bReplyAnswerCaptchaEnterthecode(caseinsensitive)*Ifyoucannotreadthecode,clickheretogenerateanewcodeCyril(admin)-2020-03-2115:23Yes,Iwilladdit!ReplyAnswerCaptchaEnterthecode(caseinsensitive)*Ifyoucannotreadthecode,clickheretogenerateanewcodecyril(admin)-2020-07-0219:53Iaddedit!ReplyAnswerCaptchaEnterthecode(caseinsensitive)*Ifyoucannotreadthecode,clickheretogenerateanewcodeikenfin-2020-06-2410:49Hi!Foundalittlebugwithsubstitutiontextparsing.Forexample,usingrubynamedgroups-https://extendsclass.com/regex/ffedfad(password:123)Whileeditingsomeunicodesymbolsinsubstitutionfieldseemsbrokeparser(playwith¢symbol)ReplyAnswerCaptchaEnterthecode(caseinsensitive)*Ifyoucannotreadthecode,clickheretogenerateanewcodeCyril(admin)-2020-06-2416:45Hi,thankyouforreportingthisbug!ReplyAnswerCaptchaEnterthecode(caseinsensitive)*Ifyoucannotreadthecode,clickheretogenerateanewcodeCyril(admin)-2020-06-2720:56Itisfixed:)ReplyAnswerCaptchaEnterthecode(caseinsensitive)*Ifyoucannotreadthecode,clickheretogenerateanewcodenhoquim-2021-01-1913:15Dear,IhavetryandaconditiongroupintheREGEXasbelow:(S120)(?:(T)|([V|W|Z]))((?(2)[1|3]|[0|1|2|3]))Thelastgroupcanbevalues1or3incaseofgroup2isselect.Incaseofgroup3isselect,thelastdigitwillbe0,1,2or3.ItworksinPythonbutnotinyoursystem.Couldyoucheck?ReplyAnswerCaptchaEnterthecode(caseinsensitive)*Ifyoucannotreadthecode,clickheretogenerateanewcodeCyril-2021-01-1914:40Hello,Iamtryingwiththestring"S120V2"andthereis1match.Canyoushareyourtest("Save&Share")?ReplyAnswerCaptchaEnterthecode(caseinsensitive)*Ifyoucannotreadthecode,clickheretogenerateanewcodeDavidSpector-2021-05-1716:24ThistoolonlyproducesaprettyequivalenttotheREitself.ItfailstoshowthePHPmatcharraythatisgenerated.Thisisimportantwhenusingthe"groups"featureofREs.ReplyAnswerCaptchaEnterthecode(caseinsensitive)*Ifyoucannotreadthecode,clickheretogenerateanewcodeSezer-2021-08-2600:57Verycoolregextester!Congrats...ReplyAnswerCaptchaEnterthecode(caseinsensitive)*Ifyoucannotreadthecode,clickheretogenerateanewcodeVJ-2021-10-1417:56Hi,Idownloadtheversionfromgitlab,triedtheregex:^[a-f0-9]{32}$Butitfailswiththeerror:resultisnotdefinedSeemsthe"$"isnotbeingaccepted.Canyoupleasehavealook.Theonlineversionworksfine.ReplyAnswerCaptchaEnterthecode(caseinsensitive)*Ifyoucannotreadthecode,clickheretogenerateanewcodeJohn-2021-12-1321:19Doesntrecognize#literalcharacter-issuesanerror"prefixnotdefined"ReplyAnswerCaptchaEnterthecode(caseinsensitive)*Ifyoucannotreadthecode,clickheretogenerateanewcodeRishabh-2022-01-0712:05Hellocreater,Thistoolisveryusefulalongwithotherfunctionaliesprovided.Imovetoregexwhenothermethodsfail.Thanks.astheysay,youtrytosolveaproblemusingregex,nowyouhavetwoproblems.ReplyAnswerCaptchaEnterthecode(caseinsensitive)*Ifyoucannotreadthecode,clickheretogenerateanewcode



請為這篇文章評分?