I'm trying to (and stumbling) write a regex that would get all the content between two patterns:
So, the patterns are like so:
/SOMEWORD:
Lots of content
/ANOTHERWORD:
So the pattern is forwardslash, word, colon. And I want to retrieve everything in between (including new lines)
I'm just learning regex and this is a little above my skill set.
This might work if Swift regex supports \\K
:
\/[^\r\n]+?:\K.*?(?=\/[^\r\n]+?:)
Just make sure the "single line" or "DOTALL" modifier is enabled; /s
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.