RegEx... Exchange
-
second some -> next
there are several filescode…
some block
some block
code…how to change in all like here:
code…
some block
next block
code… -
@Pan-Jan ,
At least try to explain the problem, or you won’t get good answers.
Someone will probably try to tell you to look for
(some block\R)some(?= block)
and replace with$1next
, but I have a feeling that “some” and “next” aren’t single words, and that “block” isn’t simple text. Those items will probably make any answers from your oversimplified and un-explained example not work in your case. -
Works perfect: 1.(some block\R)some(? = block) 2.$1next
Thank youI have this pattern: 1.(?:some block\R)\Ksome(?=.+) 2.next
I thought now the pattern would be without „\R”
How do I get rid of this \R ? -
@Pan-Jan said in RegEx... Exchange:
I thought now the pattern would be without „\R”
How do I get rid of this \R ?The
\R
means “any newline sequence”. If you want to match text that goes across multiple lines, that is the easiest way to indicate where the newline is. You could also enable. matches newline
and use.*
, but that has implications of that surprise people. -
I don’t have a \R
I have to deal with \n
-
Indeed your image above suggests that
\R
is not available to you. As @guy038 mentioned in one of your first posts in this forum
https://community.notepad-plus-plus.org/topic/19649/i-would-like-to-find-lines-where-there-are-2x-double-spaces/11?_=1595705980547
Your editor may well not have it. I can see from your image it is AkelPad which you had mentioned. Be aware that if you ask for help in thisNotepad++
forum you will get answers specific to Notepad++. Don’t expect people here to help you with a different editor!Terry
-
@Pan-Jan said in RegEx... Exchange:
I don’t have a \R
Try
\v
for vertical whitespace. Perhaps it works in that editor.