Skip to content
Tcl Source Code Artifact [a14949605b]
Login

Artifact [a14949605b]

Artifact a14949605bf2abcab8441a3cc8e4327e5f1503ef6c3ca2eb5f66a99124536313:

Ticket change [a14949605b] - Ticket [219219ffffffffff|219219ffff] <i>greedy vs. non-greedy confusion</i> status still Open with 7 other changes by dram on 2017-10-26 01:40:45.
D 2017-10-26T01:40:45.114
J assignee aku
J closer nobody
J comment OriginalBugID:\s4001\sBug\r\nVersion:\s8.2.3\r\nSubmitDate:\s'2000-01-10'\r\nLastModified:\s'2000-01-27'\r\nSeverity:\sMED\r\nStatus:\sAssigned\r\nSubmitter:\stechsupp\r\nChangedBy:\shobbs\r\nRelatedBugIDs:\s2866\r\nOS:\sBSD\r\nOSVersion:\sNetBSD-1.4.1/i386\r\nFixedDate:\s'2000-10-25'\r\nClosedDate:\s'2000-10-25'\r\n\r\n\r\nName:\shume\ssmith\r\n\r\nReproducibleScript:\r\n>\stclsh\r\n%\sregexp\s{x.*?([a-z]+)}\s{1234x56789word101112}\sa\sb\r\n1\r\n%\sset\sa\r\nx56789w\r\n%\sset\sb\r\nw\r\n%\sset\stcl_patchLevel\r\n8.2.3\r\n%\r\n\r\nObservedBehavior:\r\nthe\s+\swas\smatched\sin\sa\snongreedy\sfashion;\sshouldn't\sit\sbe\sgreedy?\r\n\r\nDesiredBehavior:\r\n%\sset\sa\r\nx56789word\r\n%\sset\sb\r\nword\r\n%\r\n\r\nPatch:\r\n\r\n\r\nPatchFiles:\r\n\r\n\r\n\r\n\r\nHenry\sSpencer\shas\snoted\ssome\sproblems\swith\smixing\sgreedy\sand\r\nnon-greedy\squantifiers\sin\sthe\snew\sregexp\scode.\s\sHe's\scc'ed\son\r\nthis,\sbut\sin\sthe\smeantime,\sthe\swork-around\sis:\r\n\s\s\s\sregexp\s{x[^a-z]*([a-z]+)}\s{1234x56789word101112}\sa\sb\s\r\n--\s01/10/2000\shobbs\r\nFrom\sHS:\r\n\r\nThis\sis\sthe\ssame\sold\sproblem:\s\speople\saccustomed\sto\sPerl\sare\snot\sgrasping\r\nthe\sidea\sthat\sthe\swhole\sRE\sis\sgreedy\sor\snon-greedy,\sbut\s*not*\ssome\smixture\r\nof\sthe\stwo.\s\sIn\sthis\scase,\sit\sis\snon-greedy\ssince\sthe\sfirst\sthing\sin\sit\r\nwhich\scares\sis\snon-greedy.\s\sThe\s+\sis\sbeing\sas\sgreedy\sas\sit\scan,\swithin\sthe\r\nconstraints\sset\sby\sthe\sbehavior\sof\sthe\swhole\sRE.\s\r\n\r\nIn\sshort,\sthe\sbehavior,\swhile\ssurprising,\sis\sas\sdocumented.\s\sIt's\snot\san\r\noutright\sbug;\sit\smay,\showever,\sbe\sa\smisfeature.\r\n\s\r\n--\s01/10/2000\shobbs
J icomment Also\sencoutered\sthis\sproblem\srecently,\swith\sa\ssimpler\scase:\r\n\r\n\s\s%\sregexp\s-inline\s{(.+?),\s(.+)}\s"foo,\sbar"\r\n\s\s{foo,\sb}\sfoo\sb\r\n\r\nBut\sthis\sis\sexpected\sbehaviour\sas\sstated\sby\sre_syntax(n),\sand\sPostgreSQL\shave\sa\smore\sthroughly\sdescription[1].\r\n\r\n\r\n[1]\shttps://www.postgresql.org/docs/10/static/functions-matching.html#functions-posix-regexp\s\s(in\s9.7.3.5. Regular\sExpression\sMatching\sRules)
J login dram
J mimetype text/plain
J severity Minor
K 219219ffffffffffffffffffffffffffffffffff
U dram
Z 852755520385c8e4837fe7a800b2d620