[Libreoffice-bugs] [Bug 112575] No regular expression for paragraph mark

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Fri Sep 22 21:27:10 UTC 2017


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

V Stuart Foote <vstuart.foote at utsa.edu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |INVALID

--- Comment #6 from V Stuart Foote <vstuart.foote at utsa.edu> ---
(In reply to Daniel Grigoras from comment #5)
> $ for paragraph mark is actually counterintuitive.
> 
> If \n stands for manual line break, then \p should have been the regular
> expression for a paragraph mark.

No, this is just the way the OOo legacy search and use the ICU based regular
expression syntax has evolved.

LibreOffice implements the ICU string search with current ICU (59.1) libraries: 
http://userguide.icu-project.org/strings/regexp

ICU Regex treats "$" as "Match at the end of a line. Line terminating
characters are \u000a, \u000b, \u000c, \u000d, \u0085, \u2028, \u2029 and the
sequence \u000d \u000a."

But there is no ICU regular expression for "paragraph mark" rather that is a LO
defined 'end of paragraph object'--CH_PAR--which are notated in search with $,
and represented on document canvas with Unicode PILCROW glyph (\u00b6) in all
fonts. But you can not search for the PILCROW just the "$" notation.

The "line break"--CH_BREAK-- "\n" symbol, or its Unicode "\u000a" point is
searchable.

And as noted in bug 108256,  a Replace with "\n" will convert the line break to
a  paragraph end mark. Not wrong, just unusual for more adept regex users.

> 
> The issue is that I cannot search for $TextToReplace, while in MS Word I can
> search for ^13TextToReplace and have it replaced with what I want, with
> nothing in this case.

$TextToReplace has no meaning--in ICU regex the $ is last position in the
match.

=-ref-=
ICU (59.1) String search - regexp
http://userguide.icu-project.org/strings/regexp

LibreOffice Help
https://help.libreoffice.org/Writer/Using_Wildcards_in_Text_Searches

https://help.libreoffice.org/Common/List_of_Regular_Expressions
Note specifics of handling of $ and \n in LibreOffice--the help article is
correct.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20170922/17a6e655/attachment-0001.html>


More information about the Libreoffice-bugs mailing list