in reply to extract all the text between two words
"^" means start of the string. You're trying to match characters that exist before the start of the string. That's impossible. If you meant to match the start of the line, change the "^" to "\n" or use the /m modifier to change the meaning of "^"..
Keep in mind that "." doesn't match newlines. You might have to use /s modifier to make "." match any character.
You might also want to change ".*" to ".*?" in order to stop at the first "CONFERENCE CALL PARTICIPANTS". Right now, you're matching until the last "CONFERENCE CALL PARTICIPANTS".
One solution, if I correctly guess what you are trying to do:
if ($transcript =~ /^CORPORATE PARTICIPANTS(.*?)^CONFERENCE CALL PARTI +CIPANTS/msi) { print($1); }
|
|---|