D 2017-10-26T01:36:45.090
J assignee aku
J closer nobody
J comment Non-greedy\squantifiers\srevert\sto\sgreedy\swhen\sused\sin\sconjunction\swith\sbranches\s(pipe\scharacter).\r\n\r\nThe\sfollowing\sbranch-free\sexpression\smatches\seach\sletter\sin\sthe\stest\sstring\sand\stherefore\scorrectly\sreturns\s14\r\nregexp\s-all\s.+?\s{this\sis\sa\stest}\r\n\r\nThe\sfollowing\sbranched\sexpression\smatches\sthe\sentire\sstring\sonly\sonce\sbecause\sthe\squantifier\sreverts\sto\sgreedy\sand\stherefore\sincorrectly\sreturns\s1\r\nregexp\s-all\s.+?|x\s{this\sis\sa\stest}\r\n\r\nThis\sbreaks\sa\slot\sof\scomplex\sregular\sexpressions\sthat\srequire\snon-greedy\squantifiers\sand\sbranches.
J icomment Still\strue\sfor\s8.6.6\r\n\r\nBut\sthis\sbehaviour\sis\sstated\sclearly\sin\sre_syntax(n)\sas:\r\n\r\n\s\sAn\sRE\sconsisting\sof\stwo\sor\smore\sbranches\sconnected\sby\sthe\s|\soperator\sprefers\slongest\smatch.\r\n\r\nBTW,\sPostgreSQL\shas\ssame\sbehaviour.\s(confirmed\sin\sPG\s9.6.4)
J login dram
J mimetype text/plain
J severity Minor
K 2798939fffffffffffffffffffffffffffffffff
U dram
Z 46e920933a0a19274d924451baee0d00