<i>RE \A and ^ don't replace the same</i> status still Open with 3 other changes
by
.
D 2026-10-10T17:51:51.351
J icomment Still\sthe\ssame\sin\s8.6,\s9.0\sand\s9.1.\sWith\s<tt>-all</tt>,\s<tt>regexp</tt>\sand\s<tt>regsub</tt>\srestarted\smatching\son\sthe\ssubstring\safter\sthe\sprevious\smatch,\sso\s<tt>\\A</tt>\smatched\sagain\sat\seach\srestart\spoint;\s<tt>^</tt>\swas\sonly\sprotected\sby\s<tt>TCL_REG_NOTBOL</tt>.\sAll\sother\sengines\s(PCRE,\sPerl,\sPython,\sJava,\sRuby,\sand\sPostgreSQL,\swhose\sengine\sis\sderived\sfrom\sTcl's)\smatch\s<tt>\\A</tt>\sonly\sonce.\n\nWord\sconstraints\sare\saffected\sthe\ssame\sway,\ssince\sthey\scould\snot\ssee\sthe\scharacter\sbefore\sthe\srestart\spoint:\s<tt>regexp\s-all\s-inline\s{\\m\\w}\s"ab\scd"</tt>\sreturns\s<tt>a\sb\sc\sd</tt>\sinstead\sof\s<tt>a\sc</tt>,\sand\s<tt>\\y</tt>\smatches\sbetween\sany\stwo\sword\scharacters.\n\nProposed\sfix\sin\sbranch\s[/timeline?r=regexp-all-search-start|regexp-all-search-start]:\ssuccessive\smatches\sare\ssearched\sfrom\sthe\scurrent\soffset\sin\sthe\swhole\sstring,\sso\s<tt>\\A</tt>\smatches\sonly\sat\sthe\sstart\s(or\sat\sthe\s<tt>-start</tt>\sindex)\sand\sword\sconstraints\ssee\sthe\sprevious\scharacter.\sTests\sregexp-29.*.\sTest\sregexp-16.4,\swhich\sexpected\sthe\sold\sbehaviour,\sis\supdated.\sThis\schanges\sbehaviour,\sso\sit\sis\sproposed\sfor\sthe\snext\sfeature\srelease,\snot\sfor\sbackporting.\sAlso\sfixes\s[884d0ac78c].
J login serhiy.storchaka
J mimetype text/x-fossil-wiki
K 471101ffffffffffffffffffffffffffffffffff
U serhiy.storchaka
Z 29d1d722246f6d87dab455d8f7112793