I am trying to build a "super non-greedy" regex, for lack of a better phrase. The problem I'm having is distilled as follows:
https://regex101.com/r/wuwOGd/2
Regex: \/\*\*(.*?)\*\/\w+\d+
Sample String: /**word1*/asdf /**word2*/abc123
What I want it to do: Only match the second token so I can extract word2
.
What it's doing: Matching word1*/asdf /**word2
which is technically correct, so I can't blame the regex for doing what I told it to do. But is there a way I can have the regex "fail" as soon as it has to expand beyond the first */
?
I'm using python in this particular case to match comment blocks attached to functions with certain signatures.
Edit:
As pointed out below, it turns out the magic word I was searching for was "tempered", not "super"!