Use this one:
^(.*?(\bpass\b)[^$]*)$
- First capture for the entire line.
- Second capture for the expected word.
Check the demo.
More explanation:
┌ first capture
|
⧽------------------⧼
^(.*?(\bpass\b)[^$]*)$
⧽-⧼ ⧽---⧼
| ⧽--------⧼ |
| | └ all characters who are not the end of the string
| |
| └ second capture
|
└ optional begin characters