Пусть в конце абзаца могут быть две строки. Абзац может не иметь окончаний, иметь только одно окончание или иметь оба окончания в любом порядке. Моя задача - захватить абзац, продолжая любую возможную комбинацию окончаний.
For this example. suppose,
the first ending is “I’m so glad to be home again!” and
the second ending is "After all, tomorrow is another day."
Some Examples:
String: "This is well-told story. After all, tomorrow is another day."
Match: "This is well-told story."
String: "A story with no end."
match: "A story with no end."
string: "A children's story. I’m so glad to be home again! After all, tomorrow is another day."
match: "A children's story."
string: "Another sentence in a Romance novel. I’m so glad to be home again!
match: "Another sentence in a Romance novel"
I tried:
.*(?=“I’m so glad to be home again)(?=After all, tomorrow is another day)
but it doesn't work for all scenarios. Thanks!