Austin Group Defect Tracker

Aardvark Mark IV


Viewing Issue Simple Details Jump to Notes ] Issue History ] Print ]
ID Category Severity Type Date Submitted Last Update
0000595 [1003.1(2008)/Issue 7] Base Definitions and Headers Editorial Error 2012-07-19 23:48 2019-06-10 08:55
Reporter eblake View Status public  
Assigned To ajosey
Priority normal Resolution Accepted  
Status Closed  
Name Eric Blake
Organization Red Hat
User Reference ebb.BRE
Section XBD 9.3
Page Number 186
Line Number 6017
Interp Status ---
Final Accepted Text
Summary 0000595: regular expressions do not operate on lines
Description The standard is clear (XBD 3.205, line 1920) that a line is a sequence of characters terminated by an included <newline>. Furthermore, the standard is clear that in situations where <newline> may appear in a regular expression pattern or in the text the pattern is to be matched against (namely, any RE used in XSH, and in explicitly documented cases within XCU), then the <newline> character is treated as normal (XBD 9.2, line 5839, see also 0000554). That is, RE matching is not done on lines, and utilities that process lines must first strip the <newline> before applying the RE. Likewise, the regular expression "^b" matched against the C string "a\nb" does not match (that is, "^" does not anchor to just after a newline character at the start of any line in the target string, but only to the beginning of the overall target string).

However, there are spots in the RE definitions that still refer to 'line' when a more appropriate term should be used.

[Implementations are still free to provide extensions where ^ matches per-line rather than per-string; for example, glibc provides an alternative regular expression interface with flag bits that determine which level of granularity the anchors behave, and whether <newline> is treated as a regular character, but that is outside the scope of this standard.]
Desired Action At line 6017 (9.3.6 BREs Matching Multiple Characters, rule 3), change:

For example, the expression "ˆ\(.*\)\1$" matches lines consisting of two adjacent appearances of the same string,

to

For example, the expression "ˆ\(.*\)\1$" matches strings consisting of two adjacent appearances of the same substring,

At line 6053 (9.3.8 BRE Expression Anchoring), change:

A BRE can be limited to matching strings that begin or end a line; this is called ‘‘anchoring’’.

to

A BRE can be limited to matching expressions that begin or end a string; this is called ‘‘anchoring’’.

At line 6175 (XBD 9.4.9 ERE Expression Anchoring), change:

An ERE can be limited to matching strings that begin or end a line; this is called ‘‘anchoring’’.

An ERE can be limited to matching expressions that begin or end a string; this is called ‘‘anchoring’’.

Tags tc2-2008
Attached Files

- Relationships
related to 0000554Closedajosey 1003.1(2008)/Issue 7 Five(?) clarifications of the informal regex descriptions 
has duplicate 0000976Closed 1003.1(2013)/Issue7+TC1 improper use of "line" to describe the ^ and $ operators 

There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
2012-07-19 23:48 eblake New Issue
2012-07-19 23:48 eblake Status New => Under Review
2012-07-19 23:48 eblake Assigned To => ajosey
2012-07-19 23:48 eblake Name => Eric Blake
2012-07-19 23:48 eblake Organization => Red Hat
2012-07-19 23:48 eblake User Reference => ebb.BRE
2012-07-19 23:48 eblake Section => XBD 9.3
2012-07-19 23:48 eblake Page Number => 186
2012-07-19 23:48 eblake Line Number => 6017
2012-07-19 23:48 eblake Interp Status => ---
2012-07-20 15:20 eblake Relationship added related to 0000554
2012-07-26 15:59 Don Cragun Status Under Review => Resolved
2012-07-26 15:59 Don Cragun Resolution Open => Accepted
2012-07-26 15:59 Don Cragun Tag Attached: tc2-2008
2015-09-23 08:21 geoffclare Relationship added has duplicate 0000976
2019-06-10 08:55 agadmin Status Resolved => Closed


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker