|
2024-08-24
| ||
| 11:06 | Mrge [d68fd866c4199176]: Fix [4ed788c618]: regexp \U not fully implemented - unclear in docs. check-in: a13a354899 user: pooryorick tags: unchained, INCOMPATIBLE_LICENSE | |
|
2023-11-22
| ||
| 13:12 | • Closed ticket [4ed788c618]: regexp \U not fully implemented - unclear in docs</i... artifact: 376c827602 user: jan.nijtmans | |
|
2023-11-21
| ||
| 08:18 | Fix [4ed788c618]: regexp \U not fully implemented - unclear in docs check-in: 21eaa89b6b user: jan.nijtmans tags: core-8-branch | |
| 02:39 | • Ticket [4ed788c618] regexp \U not fully implemented - unclear in docs status... artifact: a84c9b7876 user: juliannoble2 | |
|
2023-11-20
| ||
| 22:26 | • Ticket [4ed788c618]: 5 changes artifact: 359d7a3b8b user: jan.nijtmans | |
| 22:13 | Experimental fix for [4ed788c618]: regexp \U not fully implemented - unclear in docs closed check-in: f31a38e350 user: jan.nijtmans tags: bug-4ed788c618 | |
|
2023-11-18
| ||
| 19:30 | • New ticket [4ed788c618] regexp \U not fully implemented - unclear in docs. artifact: b5acf31629 user: juliannoble2 | |
regexp \U not fully implemented - unclear in docs
Closed / Fixed4ed788c618b36e1247bd276c985c750c3b2267bdCreated 3 years agoUpdated 3 years ago
Descriptionplain2023-11-18 19:30:45
egexp of \Ustuvwxyz is mentioned in the re_syntax docs below \uwxyz but behaves quite differently.
\u can be used in braced expressions - whereas \U only seems to function properly in unbraced regexes where the \U entries become literal characters.
It is unclear whether this is intentional or awaiting implementation in the core for regexp. The docs for \U mention 'reserved for a Unicode extension up to 21 bits'. The wording here could be clarified if that means it is not intended to function out of the box.
Character ranges for braced \U regexes work in the range up to FFFF when the upper bound is expressed as \U0000FFFF or equivalent, but only up to FFFD if the upper bound is expressed as \U0010FFFF
(I note that FFFE and FFFF are 'noncharacters' - but there are 32 other noncharacters in the BMP that aren't excluded. For best utility, I wouldn't expect any to be excluded in this context - but if the wording in docs refers to 'characters' rather than codepoints or whatever terminology is appropriate here, and it really is the intention to exclude noncharacters; then that's another point that may need explanation)
90b1rc
% regexp -all -inline -indices {[\U00000080-\U0000FFFF]} X\UFFFEY
{1 1}
% regexp -all -inline -indices {[\U00000080-\U0010FFFF]} X\UFFFEY
%
Higher tests can be done with substituted regexes rather than braced ones - but that is much less convenient as regexes get more complex, and different enough from the \u behaviour that it may warrant more explicit documentation if it isn't intended to operate similarly without some sort of extra package.
90b1rc
% regexp -all -inline -indices "\[\U00000080-\U0010FFFF\]" X\U1FFFFY
{1 1}
This isn't specific to the 90-b1 release candidate - but I notice that there are at least 3 different behaviours for certain \U regexes in recent years, which I guess isn't surprising given the complex work being done to support unicode in Tcl, but it does underscore a need to have the docs reflect intended behaviour.
8.6.12
%regexp -all -inline -indices {[\U80-\U0000FFFF]} X\U0001FFFFY
{1 1}
bawt 8.7a5
%regexp -all -inline -indices {[\U80-\U0000FFFF]} X\U0001FFFFY
{1 1} {2 2}
8.7a6 (+)
% regexp -all -inline -indices {[\U80-\U0000FFFF]} X\U0001FFFFY
%
Referenced by3
a13a354899Mrge [d68fd866c4199176]: Fix [4ed788c618]: regexp \U not fully implemented - unclear in docs. check-in2024-08-24 11:06:5721eaa89b6bFix [4ed788c618]: regexp \U not fully implemented - unclear in docs check-in2023-11-21 08:18:25f31a38e350Experimental fix for [4ed788c618]: regexp \U not fully implemented - unclear in docs check-in2023-11-20 22:13:38
jan.nijtmanswiki2023-11-20 22:26:15
Does [this] help?
juliannoble2plain2023-11-21 02:39:29
It does indeed - thanks!
jan.nijtmanswiki2023-11-22 13:12:44
Fixed [here]. Many thanks for the report!
Log in (anonymous is fine) to add a comment.