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] Wed Feb 15 06:31:36 -0800 
2006 -------
> I thought '&' means the entire match. For example,

It does and \0 also does.
But I must admit that I was wrong in thinking perl knows \0, it's only available
in PHP's preg_* and ereg_*.

& is new to me for being an regex operator, but I mainly know regex from Perl
and PHP, not from sed a.s.o.

>> Also something like '\\\t' now works as I'd expect:
>
> Insert a backslash followed by a tabulator?

Yes. But the current code only removes *one* backslash, regardless how much
exist in the sequence.

> Is it possible to add the other escape-sequences as well? (like for
> newline (as opposed to paragraph-break that unfortunately already is
> \n in the replace-box)

Should be possible, if I know what sequences to use. Currently I can't see in
what difference Return vs. Shift+Return results in reality.


Frankly said, I don't like & (as well as $1...$9) because it complicates (and
slows down) the replace code. If you've looked at the patch, you know it loops
over the replace string, searching for a backslash. If it encounters one, it
looks what character is next. If the code has to be able to handle \ as well as
& (and maybe $) as first char of a special sequence, I currently think I'll need
to loop over the string several times in several loops.


For now I've modified ActualStrReplace() and prefaced the main Search loop with
another in which unescaped & are replaced by \0. So & and \0 are synonyms now.


I'd be happy if someone would say anything about the actual code. Maybe there's
some even simpler way to do the replace. And there might exist some better
method to use for the main loop than Search (like it would be strcspn for plain
C-strings), but I'm not that firm with all the string handling in OOo.

---------------------------------------------------------------------
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