in reply to Quick Regex quesiton
Or if you don't care about them being separate, you could use the followingmy $test = do {local $/; <DATA>}; if ($test =~ m{((?:deferred|unrealized).*?\.)\s*(.*?\.)\s*(.*?\.)}s) { print "print '$1', '$2', '$3'"; } __DATA__ foo bar. baz biz. deferred gross profit is blah blah blah. more blah. and yet more blah. But not this blah.
if ($test =~ m{(?=deferred|unrealized)((?:.*?\.){3})}s) {
|
|---|