RegExp: Last occurence of pattern that occurs before another pattern
问题 I want to take a text pattern that occurs the last before another text pattern. For example I have this text: code 4ab6-7b5 Another lorem ipsum Random commentary. code f6ee-304 Lorem ipsum text Dummy text code: ebf6-649 Other random text id-x: 7662dd41-29b5-9646-a4bc-1f6e16e8095e code: abcd-ebf Random text id-x: 7662dd41-29b5-9646-a4bc-1f6e16e8095e I want to take the last code that occurs before the first occurrence of id-x (which means I want to get code ebf6-649 ) How can I do that with