I wanted to extract all the text before the last occurrence of a specific word:
Please note again that and-approved forms are not to be count toward the page limit. To the extent possible, please limit the appendix file to one 50-page PDF submission.
The Project Description must be clear, concise, and complete. is particularly interested in Project Descriptions that convey strategies for achieving intended performance. Project Descriptions are evaluated on the basis of substance and measurable outcomes, not length. Cross-referencing should be used rather than repetition. Supporting documents designated as required must be included in the Appendix of the document
Clearly identify the physical, economic, social, financial, institutional, and/or other problem(s) requiring a solution. The need for assistance, including the nature and scope of the problem, must be demonstrated. Supporting documentation, such as letters of support and testimonials from concerned parties, may be included in the Appendix. Any relevant data based on planning studies or needs assessments should be included or referred to in the endnotes or footnotes. Incorporate demographic data and participant/beneficiary information, as available.
Appendix
Any relevant data based on planning studies or needs assessments should be included or referred to in the endnotes or footnotes. Incorporate demographic data and participant/beneficiary information, as available.
And I want to all the text before the last Appendix (excluding Appendix)
currently using this
sub("(.*)Appendix", "", text)
but it only get all the text in the paragraph with the first Appendix. How do I adjust the regex.
Expected output:
Please note again that and-approved forms are not to be count toward the page limit. To the extent possible, please limit the appendix file to one 50-page PDF submission.
The Project Description must be clear, concise, and complete. is particularly interested in Project Descriptions that convey strategies for achieving intended performance. Project Descriptions are evaluated on the basis of substance and measurable outcomes, not length. Cross-referencing should be used rather than repetition. Supporting documents designated as required must be included in the Appendix of the document
Clearly identify the physical, economic, social, financial, institutional, and/or other problem(s) requiring a solution. The need for assistance, including the nature and scope of the problem, must be demonstrated. Supporting documentation, such as letters of support and testimonials from concerned parties, may be included in the Appendix. Any relevant data based on planning studies or needs assessments should be included or referred to in the endnotes or footnotes. Incorporate demographic data and participant/beneficiary information, as available.