Matches words followed by a specific pattern using positive lookahead.
/\w+(?=\s+dollars)/gi
const regex = /\w+(?=\s+dollars)/gi; const result = str.match(regex);
import re pattern = re.compile(r'\w+(?=\s+dollars)', re.IGNORECASE) result = pattern.findall(text)
import "regexp" re := regexp.MustCompile(`(?i)\w+(?=\s+dollars)`) result := re.FindAllString(text, -1)