Tcl Source Code

Artifact [3b22e98da4]
Login

Artifact 3b22e98da4efc7957b03c0194c40b743cefc7c75:

Ticket change [3b22e98da4] - New ticket [fe4fca32d9] mixed-greediness regular expressions need better documentation. by glennj 2015-03-24 14:55:43.
D 2015-03-24T14:55:43.072
J assignee nobody
J closer nobody
J cmimetype text/plain
J comment Currently,\sthe\sMATCHING\ssection\sof\sthe\sre_syntax\sman\spage\stalks\sabout\s"preferences",\sand\sstates:\r\n\r\n>\sA\sbranch\shas\sthe\ssame\spreference\sas\sthe\sfirst\squantified\satom\sin\sit\swhich\shas\sa\spreference.\r\n\r\nI\sdon't\sthis\sthis\sis\ssufficiently\sclear\sto\sillustrate\sthe\sdifferences\sbetween\r\n\r\n\s\s\s\s$\sperl\s-e\s'if\s("1234"\s=~\s/(\\d+?)(\\d+)/)\s{print\s"$&\s$1\s$2\\n"}'\r\n\s\s\s\s1234\s1\s234\r\n\s\s\s\s$\secho\s'puts\s[regexp\s-inline\s{(\\d+?)(\\d+)}\s"1234"]'\s|\stclsh\r\n\s\s\s\s12\s1\s2\r\n\r\nCan\swe\shave\san\sexplicit\sstatement?\sSomething\slike:\r\n\r\n>\sIf\sthe\sfirst\squantifier\sin\sa\sbranch\sof\sa\sRE\sis\snon-greedy,\s/all/\squantifiers\sin\sthe\sbranch\swill\sbe\sconsidered\sas\snon-greedy.\r\n\r\nHowever,\sI\sjust\snoticed\ssomething\sI\scan't\sexplain:\swhat's\sthe\sdifference\sbetween\sthese?\r\n\r\n\s\s\s\s$\secho\s'puts\s[regexp\s-inline\s{(?:(\\d+?)(\\d+))}\s"1234"]'\s|\stclsh\r\n\s\s\s\s12\s1\s2\r\n\s\s\s\s$\secho\s'puts\s[regexp\s-inline\s{s+?|(?:(\\d+?)(\\d+))}\s"1234"]'\s|\stclsh\r\n\s\s\s\s1234\s1\s234
J foundin 8.6
J is_private 0
J login glennj
J priority 5\sMedium
J private_contact d3087a52abea86234116c6d0fc932ab13864ef48
J resolution None
J severity Minor
J status Open
J submitter glennj
J subsystem -\sNew\sBuiltin\sCommands
J title mixed-greediness\sregular\sexpressions\sneed\sbetter\sdocumentation
J type Bug
K fe4fca32d988f67704a9fec3372bf340c81c3cef
U glennj
Z 4032d64656104306fb227284f3d84def