How to tell a RegEx to be greedy on an 'Or' Expression
问题 Text: [A]I'm an example text [] But I want to be included [[]] [A]I'm another text without a second part [] Regex: \[A\][\s\S]*?(?:(?=\[\])|(?=\[\[\]\])) Using the above regex, it's not possible to capture the second part of the first text. Demo Is there a way to tell the regex to be greedy on the 'or'-part? I want to capture the biggest group possible. Edit 1: Original Attempt: Demo Edit 2: What I want to achive: In our company, we're using a webservice to report our workingtime. I want to