# Regular Expression Limitation with Paragraph Replacement

I got into a situation where it seems like there is no way forward.

After : there is paragraph break which I want to remove but when I search using :$, it searches just fine but no matter what I put in replace box, it doesn't remove the paragraph break. I found that When I search :$ then it will search a paragraph break after : but won't remove the paragraph mark. Tabs, newlines, paragraphs \t \n $So any alternative to this. I tried with Alt Search as well but it won't let me do the thing either. edit retag close merge delete ## 2 Answers Sort by » oldest newest most voted I do not write in Hindi or anything in 'Complex Text Layot' but I tested a bit just now with AltSerach V1.4.1 in LibO V5.2.2. (The previos AS V1.4 does not list LibO V5.) You know that AltSearch is using a slightly extended and different coding?$ is a "zero-width-lookahead-assertion" functionally while \p is denoting the next-paragraph-mark itself. Found groups (parentheses used in the search string) are denoted \1, \2 and so on in AltSearch.

Seraching for (:)\p the correct substrings were found - also if the text was inside a right to left sequence. Using \1 as replace string then replaced the combined finding with the colon allone and the next-paragraph-mark was deleted.

more

You my friend, are a lifesaver. :-)

( 2016-11-30 14:22:48 +0100 )edit

Indeed, you cannot cross paragraph borders with the build-in regular expressions engine. That is: you can search for a paragraph break alone or for something that's at the en of a paragraph, but not both at the same time.

Try with the AltSearch extension instead that provides more options (maybe you need to use the [::BigBlock::] tag provided by the extension)

more