Anonymous | Login | 2024-04-18 22:00 UTC |
Main | My View | View Issues | Change Log | Docs |
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 | |||||||||||||
|
There are no notes attached to this issue. |
Mantis 1.1.6[^] Copyright © 2000 - 2008 Mantis Group |