https://bugs.freedesktop.org/show_bug.cgi?id=60183

--- Comment #1 from Johnny Rosenberg <[email protected]> ---
Syntax could be something like this:
SUBSTITUTE("Text"; "SearchText"; "NewText"; Occurrence; Regular expressions)

Text is the text in which text segments are to be exchanged.

SearchText is the text segment that is to be replaced (a number of times).

NewText is the text that is to replace the text segment.

Occurrence (optional) indicates which occurrence of the search text is to be
replaced. If this parameter is missing the search text is replaced throughout.

Regular expressions (optional) indicates wether regular expressions are used or
not. If this parameter is 1, regular expressions are allowed, when 0 or
missing, regular expressions are not allowed. This makes it backwards
compatible with the old behaviour.

Example

=SUBSTITUTE("123123123";"3";"abc") returns 12abc12abc12abc.

=SUBSTITUTE("123123123";"3";"abc";2) returns 12312abc123.

=SUBSTITUTE("123abc1.25w3";"^.*([:digit:]+)([,\.]{0,1})([:digit:]*).*$";"$1,$3";;1)
returns 1,25 (with reservations for typos…).


I think this would be a killer feature for some users.

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to