To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=15666





------- Additional comments from [EMAIL PROTECTED] Tue Aug 22 08:57:49 -0700 
2006 -------
I may be missing something, but the IEEE document that er posted specifies the
regular expression for regexec and regcomp only, and does not specify the syntax
for replace. Back references in this document appears to discuss references in
the match pattern only.

IMHO, We've already had this discussion and decided that implementing a replace
without an '&' does not follow convention. Since there is no dispute over the
definition of '&' in the replace string, I believe we should not be trying to
change this behavior.

Here is the behavior of Perl, PHP, and sed using the '&' and '\0' substitution
patters for the string "123 ABC DEF GHI":

perl -> 's/123 (AB). (DE). (GH)./$&'       -> '123 ABC DEF GHI'
perl -> 's/123 (AB). (DE). (GH)./$0'       -> '_'

sed  -> 's/123 \(AB\). \(DE\). \(GH\)./&'  -> '123 ABC DEF GHI'
sed  -> 's/123 \(AB\). \(DE\). \(GH\)./\0' -> '123 ABC DEF GHI'

php  -> 's/123 (AB). (DE). (GH)./&/'       -> '&'
php  -) 's/123 (AB). (DE). (GH)./\0/'      -> '123 ABC DEF GHI'

Note: while php and sed support the '\0' behavior, perl does not support '$0'.

Only Microsoft replaces '\0' with all the matched subgroups.

This creates a dilemma since Microsoft users expect one behavior and the open
source world expects another. 

The best of all worlds would support two syntaxes and allow the user to select
between them. I can see having a replace check box option labeled "use Microsoft
replace" that would change the behavior to use the complete Microsoft syntax.

For the time being, I suggest that we try to stick with GNU sed, Perl, and PHP
and support both '&' and '\0' for whole string replace and revisit Microsoft
compatibility at a later date.


---------------------------------------------------------------------
Please do not reply to this automatically generated notification from
Issue Tracker. Please log onto the website and enter your comments.
http://qa.openoffice.org/issue_handling/project_issues.html#notification

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to