https://bugs.documentfoundation.org/show_bug.cgi?id=38261

--- Comment #25 from Adalbert Hanßen <[email protected]> ---
(In reply to Jax from comment #12)
> Bump.  This bugz me, and always has, that LO, & OO before it, don't have the
> complex Find & Replace features that are so much better handled in M$
> Office.  The features of good F&R are pretty much crucial to my effective
> processing of documents, so I'd like to see this given fairly high priority.
> F&R is a real 'guts' issue that underpins the bells and whistles stuff.
> 
> AltSearch 1.4.1 is available but is buggy, not able to complete some of the
> features that it has and really quite broken on some installations (I tried
> to install it on a friend's Mac on OO - presume that LO is the same).
> 
> I'm not a coder, but very willing to help test this.  Anyone?

"Now", i.e. since 2017, AltSearch 1.4.2 is available. It has some important
features:

* it can search for regular expressions. Unfortunately the ? quantifier (at
least once, but you may circumvent that one by {1,}) and the * quantifier (any
number of times including zero times) don't work, also lookback and
lookahead-conditions are not supported (e.g. (?<=-)(\d{2})(?=-)  meaning exact
2 digits with a minus sign before and after them which are not caught by the
regex)

* searching for \p and replacing it by \n lets you exchange paragraph marks by
forced line feeds, a function which I use very often and which misses terribly
in LO Writer and which alone probably would be easily implementabel,

* it can search for all occurrences of a given character prototype. Once they
are found and marked (unfortunately this takes a lot of time) you can assign
just another character prototype to all found samples (LO Writer can't do
that),

* it can search for all occurrences of a given paragraph prototype. Once they
are found and marked (unfortunately this takes a lot of time) you can assign
just another paragraph prototype to all found paragraphs (LO Writer also can do
that),

* it can search for a whole range of other text properties e.g. italics,
underline, hyperlinks, ... (I have not tried them out).

For men, replace any paragraph marks (including any number of white spaces
before them) by a linefeed is the most used function of AltSearch.

Due to the implementation in some type of Basic interpreter, AltSearch is very
slow. Unfortunately it is not free from bugs. The worst one I know about is
that it might remove the whole highlighted region if it is part of a table. To
safeguard me from this bug, I always extract the whole range where AltSearch
shall be applied (if it is part of a table) to a new document and do the
replacements there. When done, I cut it from the intermediate document and
paste it to the table where the stuff belongs.

Meanwhile LibreOffice has some regular expression capabilities. Lookahead and
lookbehind work. Unfortunately \1 \2, \3... for capture groups don't work in
the replacement part (one would e.g. use this to transform date in the form
mm/dd/yyyy to dd.mm.yyyy or yyyy-mm-dd).

The important missing thing in LO's replace dialog with respect to regular
expressions is the ability to store regexes + replacement rules and assign
names to them in order to reuse them. AltSearch shows a good model for an user
interface for that.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to