You can use this awful looking regex:
/[az](?:(?:(?:drs?|m[rs])\.)|[^.|?|!])*friends(?:(?:(?:drs?|m[rs])\.)|[^.|?|!])*[\"!?:\.]/i
You can replace the word friends with what you want to combine.
Please note that it MUST NOT be if friends is the first word.
You can use this one that matches if friends is the first word:
/(?:friends|[az])?(?:(?:(?:drs?|m[rs])\.)|[^.|?|!])*friends(?:(?:(?:drs?|m[rs])\.)|[^.|?|!])*[\"!?:\.]/i
This will match the space immediately before the sentence.
If this is a problem, you can use this:
/\s*((?:friends|[az])?(?:(?:(?:drs?|m[rs])\.)|[^.|?|!])*friends(?:(?:(?:drs?|m[rs])\.)|[^.|?|!])*[\"!?:\.])/i
This will save the entire offer for $1 and will work if friends is the first offer.
All have been tested using Javascript and should work for other tastes.
source share