I have a string that looks something like this:
DOG[i want to look for specific hits of stuff here]
I want to match any occurrences of the words "look" or "stuff" that occur between the opening DOG[ and the closing ]
I know I can write a rege like (?<=DOG\[).*?(?=\]) to find all text between the opening and closing bits, but I want to look for only specific words between these openers and closers.
How can I do this?
(?<=DOG\[[^][]*?)(?:look|stuff)(?=[^][]*])