Answer the question
In order to leave comments, you need to log in
How to specify in a regular expression that the end of one match should be used as the beginning of the next?
Hello!
There is a text.
Conventionally, it can be represented as follows:
Example: there is a lot of any
text with line breaks,
special characters, and so on. Example: i.e. unambiguous sampling of the text of the example cannot be done
/Пример:.+?(?:Пример:|$)/m
selects examples through one, since the word "Example" is used twice in each match. How can this be avoided? /мер:.+?(?:При:|$)/m
works, but potentially it may not work, since "With:", theoretically, can occur in the middle of the text of the example Answer the question
In order to leave comments, you need to log in
Thank you all :)
Earned and blunted. You can just break the text by the word "Example:" :) :)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question