pyregularexpression


Namepyregularexpression JSON
Version 0.1.0 PyPI version JSON
download
home_pageNone
SummaryCollection of reusable regular‑expression patterns
upload_time2025-09-03 22:33:38
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseApache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
keywords regex regular expressions patterns
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # pyRegularExpression

This package provides a collection of regular expression-based functions to identify and extract components of the scientific process from text. These components include things like identifying if a text discusses adherence, compliance, eligibility criteria, and more.

## Installation

```bash
pip install pyregularexpression
```

## Available Finder Modules

This package contains a number of finder modules, each designed to find a specific concept in a text. Each module contains one or more functions that implement different versions of a regular expression with varying levels of precision and recall.

Below is a list of the available finder modules and their purpose:

* **Adherence Compliance** (`adherence_compliance_finder.py`): adherence_compliance_finder.py – precision/recall ladder for *treatment adherence / compliance* metrics.
    *   `find_adherence_compliance_v1(text)`
    *   `find_adherence_compliance_v2(text, window=4)`
    *   `find_adherence_compliance_v3(text, block_chars=400)`
    *   `find_adherence_compliance_v4(text, window=12)`
    *   `find_adherence_compliance_v5(text)`
* **Algorithm Validation** (`algorithm_validation_finder.py`): algorithm_validation_finder.py – precision/recall ladder for *algorithm validation* statements.
    *   `find_algorithm_validation_v1(text)`
    *   `find_algorithm_validation_v2(text, window=4)`
    *   `find_algorithm_validation_v3(text, block_chars=400)`
    *   `find_algorithm_validation_v4(text, window=12)`
    *   `find_algorithm_validation_v5(text)`
* **Allocation Concealment** (`allocation_concealment_finder.py`): allocation_concealment_finder.py – precision/recall ladder for *allocation concealment* methods.
    *   `find_allocation_concealment_v1(text)`
    *   `find_allocation_concealment_v2(text, window=4)`
    *   `find_allocation_concealment_v3(text, block_chars=400)`
    *   `find_allocation_concealment_v4(text, window=12)`
    *   `find_allocation_concealment_v5(text)`
* **Attrition Criteria** (`attrition_criteria_finder.py`): attrition_criteria_finder.py – precision/recall ladder for *attrition criteria* (post‑enrolment loss).
    *   `find_attrition_criteria_v1(text)`
    *   `find_attrition_criteria_v2(text, window=4)`
    *   `find_attrition_criteria_v3(text, block_chars=400)`
    *   `find_attrition_criteria_v4(text, window=12)`
    *   `find_attrition_criteria_v5(text)`
* **Background Rationale** (`background_rationale_finder.py`): background_rationale_finder.py – precision/recall ladder for *study background / rationale* statements.
    *   `find_background_rationale_v1(text)`
    *   `find_background_rationale_v2(text, window=4)`
    *   `find_background_rationale_v3(text, block_chars=500)`
    *   `find_background_rationale_v4(text, window=12)`
    *   `find_background_rationale_v5(text)`
* **Baseline Data** (`baseline_data_finder.py`): baseline_data_finder.py – precision/recall ladder for *baseline participant characteristics*.
    *   `find_baseline_data_v1(text)`
    *   `find_baseline_data_v2(text, window=4)`
    *   `find_baseline_data_v3(text, block_chars=400)`
    *   `find_baseline_data_v4(text, window=12)`
    *   `find_baseline_data_v5(text)`
* **Blinding Masking** (`blinding_masking_finder.py`): blinding_masking_finder.py – precision/recall ladder for *blinding / masking* status.
    *   `find_blinding_masking_v1(text)`
    *   `find_blinding_masking_v2(text, window=4)`
    *   `find_blinding_masking_v3(text, block_chars=400)`
    *   `find_blinding_masking_v4(text, window=12)`
    *   `find_blinding_masking_v5(text)`
* **Changes To Outcomes** (`changes_to_outcomes_finder.py`): changes_to_outcomes_finder.py – precision/recall ladder for *changes to prespecified outcomes after trial initiation*.
    *   `find_changes_to_outcomes_v1(text)`
    *   `find_changes_to_outcomes_v2(text, window=4)`
    *   `find_changes_to_outcomes_v3(text, block_chars=400)`
    *   `find_changes_to_outcomes_v4(text, window=12)`
    *   `find_changes_to_outcomes_v5(text)`
* **Comparator Cohort** (`comparator_cohort_finder.py`): comparator_cohort_finder.py – precision/recall ladder for *comparator (control) cohort* statements.
    *   `find_comparator_cohort_v1(text)`
    *   `find_comparator_cohort_v2(text, window=4)`
    *   `find_comparator_cohort_v3(text, block_chars=400)`
    *   `find_comparator_cohort_v4(text, window=12)`
    *   `find_comparator_cohort_v5(text)`
* **Competing Risk Analysis** (`competing_risk_analysis_finder.py`): competing_risk_analysis_finder.py – precision/recall ladder for *competing‑risk analyses*.
    *   `find_competing_risk_analysis_v1(text)`
    *   `find_competing_risk_analysis_v2(text, window=4)`
    *   `find_competing_risk_analysis_v3(text, block_chars=400)`
    *   `find_competing_risk_analysis_v4(text, window=12)`
    *   `find_competing_risk_analysis_v5(text)`
* **Conflict Of Interest** (`conflict_of_interest_finder.py`): conflict_of_interest_finder.py – precision/recall ladder for *conflict‑of‑interest disclosures*.
    *   `find_conflict_of_interest_v1(text)`
    *   `find_conflict_of_interest_v2(text, window=4)`
    *   `find_conflict_of_interest_v3(text, block_chars=400)`
    *   `find_conflict_of_interest_v4(text, window=12)`
    *   `find_conflict_of_interest_v5(text)`
* **Covariate Adjustment** (`covariate_adjustment_finder.py`): covariate_adjustment_finder.py – precision/recall ladder for *covariate adjustment* statements.
    *   `find_covariate_adjustment_v1(text)`
    *   `find_covariate_adjustment_v2(text, window=4)`
    *   `find_covariate_adjustment_v3(text, block_chars=300)`
    *   `find_covariate_adjustment_v4(text, window=6)`
    *   `find_covariate_adjustment_v5(text)`
* **Data Access** (`data_access_finder.py`): data_access_finder.py – precision/recall ladder for *data‑access / availability* statements.
    *   `find_data_access_v1(text)`
    *   `find_data_access_v2(text, window=3)`
    *   `find_data_access_v3(text, block_chars=400)`
    *   `find_data_access_v4(text, window=12)`
    *   `find_data_access_v5(text)`
* **Data Linkage Method** (`data_linkage_method_finder.py`): data_linkage_method_finder.py – precision/recall ladder for *data‑linkage methods*.
    *   `find_data_linkage_method_v1(text)`
    *   `find_data_linkage_method_v2(text, window=3)`
    *   `find_data_linkage_method_v3(text, block_chars=400)`
    *   `find_data_linkage_method_v4(text, window=12)`
    *   `find_data_linkage_method_v5(text)`
* **Data Provenance** (`data_provenance_finder.py`): data_provenance_finder.py – precision/recall ladder for *data provenance*
    *   `find_data_provenance_v1(text)`
    *   `find_data_provenance_v2(text, window=4)`
    *   `find_data_provenance_v3(text, block_chars=400)`
    *   `find_data_provenance_v4(text, window=12)`
    *   `find_data_provenance_v5(text)`
* **Data Safety Monitoring** (`data_safety_monitoring_finder.py`): data_safety_monitoring_finder.py – precision/recall ladder for *Data‑Safety Monitoring* descriptions.
    *   `find_data_safety_monitoring_v1(text)`
    *   `find_data_safety_monitoring_v2(text, window=4)`
    *   `find_data_safety_monitoring_v3(text, block_chars=400)`
    *   `find_data_safety_monitoring_v4(text, window=12)`
    *   `find_data_safety_monitoring_v5(text)`
* **Data Sharing Statement** (`data_sharing_statement_finder.py`): data_sharing_statement_finder.py – precision/recall ladder for *data‑sharing statements*.
    *   `find_data_sharing_statement_v1(text)`
    *   `find_data_sharing_statement_v2(text, window=4)`
    *   `find_data_sharing_statement_v3(text, block_chars=400)`
    *   `find_data_sharing_statement_v4(text, window=12)`
    *   `find_data_sharing_statement_v5(text)`
* **Data Source Type** (`data_source_type_finder.py`): data_source_type_finder.py – precision/recall ladder for *data‑source type* declarations.
    *   `find_data_source_type_v1(text)`
    *   `find_data_source_type_v2(text, window=2)`
    *   `find_data_source_type_v3(text, block_chars=400)`
    *   `find_data_source_type_v4(text, window=12)`
    *   `find_data_source_type_v5(text)`
* **Demographic Restriction** (`demographic_restriction_finder.py`): demographic_restriction_finder.py – precision/recall ladder for demographic‑restriction statements.
    *   `find_demographic_restriction_v1(text)`
    *   `find_demographic_restriction_v2(text, window=4)`
    *   `find_demographic_restriction_v3(text, block_chars=400)`
    *   `find_demographic_restriction_v4(text, window=12)`
    *   `find_demographic_restriction_v5(text)`
* **Dose Response Analysis** (`dose_response_analysis_finder.py`): dose_response_analysis_finder.py – precision/recall ladder for *dose‑response / exposure‑response analyses*.
    *   `find_dose_response_analysis_v1(text)`
    *   `find_dose_response_analysis_v2(text, window=4)`
    *   `find_dose_response_analysis_v3(text, block_chars=400)`
    *   `find_dose_response_analysis_v4(text, window=12)`
    *   `find_dose_response_analysis_v5(text)`
* **Eligibility Criteria** (`eligibility_criteria_finder.py`): eligibility_criteria_finder.py – precision/recall ladder for *inclusion / exclusion eligibility criteria* statements.
    *   `find_eligibility_criteria_v1(text)`
    *   `find_eligibility_criteria_v2(text, window=4)`
    *   `find_eligibility_criteria_v3(text, block_chars=500)`
    *   `find_eligibility_criteria_v4(text, window=12)`
    *   `find_eligibility_criteria_v5(text)`
* **Entry Event** (`entry_event_finder.py`): entry_event_finder.py – precision/recall ladder for *entry‑event* statements.
    *   `find_entry_event_v1(text)`
    *   `find_entry_event_v2(text, window=4)`
    *   `find_entry_event_v3(text, block_chars=400)`
    *   `find_entry_event_v4(text, window=12)`
    *   `find_entry_event_v5(text)`
* **Ethics Approval** (`ethics_approval_finder.py`): ethics_approval_finder.py – precision/recall ladder for *ethics approval & consent* statements.
    *   `find_ethics_approval_v1(text)`
    *   `find_ethics_approval_v2(text, window=4)`
    *   `find_ethics_approval_v3(text, block_chars=400)`
    *   `find_ethics_approval_v4(text, window=12)`
    *   `find_ethics_approval_v5(text)`
* **Event Adjudication** (`event_adjudication_finder.py`): event_adjudication_finder.py – precision/recall ladder for *event‑adjudication descriptions*.
    *   `find_event_adjudication_v1(text)`
    *   `find_event_adjudication_v2(text, window=5)`
    *   `find_event_adjudication_v3(text, block_chars=400)`
    *   `find_event_adjudication_v4(text, window=12)`
    *   `find_event_adjudication_v5(text)`
* **Exclusion Rule** (`exclusion_rule_finder.py`): exclusion_rule_finder.py – precision/recall ladder for *exclusion‑rule* statements.
    *   `find_exclusion_rule_v1(text)`
    *   `find_exclusion_rule_v2(text, window=4)`
    *   `find_exclusion_rule_v3(text, block_chars=400)`
    *   `find_exclusion_rule_v4(text, window=12)`
    *   `find_exclusion_rule_v5(text)`
* **Exit Criterion** (`exit_criterion_finder.py`): exit_criterion_finder.py – precision/recall ladder for *exit-criterion* statements.
    *   `find_exit_criterion_v1(text)`
    *   `find_exit_criterion_v2(text, window=4)`
    *   `find_exit_criterion_v3(text, block_chars=400)`
    *   `find_exit_criterion_v4(text, window=12)`
    *   `find_exit_criterion_v5(text)`
* **Exposure Definition** (`exposure_definition_finder.py`): exposure_definition_finder.py – precision/recall ladder for *exposure definition* statements.
    *   `find_exposure_definition_v1(text)`
    *   `find_exposure_definition_v2(text, window=4)`
    *   `find_exposure_definition_v3(text, block_chars=400)`
    *   `find_exposure_definition_v4(text, window=12)`
    *   `find_exposure_definition_v5(text)`
* **Follow Up Period** (`follow_up_period_finder.py`): follow_up_period_finder.py – precision/recall ladder for *follow‑up period* definitions.
    *   `find_follow_up_period_v1(text)`
    *   `find_follow_up_period_v2(text, window=4)`
    *   `find_follow_up_period_v3(text, block_chars=400)`
    *   `find_follow_up_period_v4(text, window=12)`
    *   `find_follow_up_period_v5(text)`
* **Funding Statement** (`funding_statement_finder.py`): funding_statement_finder.py – precision/recall ladder for *study funding statements*.
    *   `find_funding_statement_v1(text)`
    *   `find_funding_statement_v2(text, window=4)`
    *   `find_funding_statement_v3(text, block_chars=400)`
    *   `find_funding_statement_v4(text, window=12)`
    *   `find_funding_statement_v5(text)`
* **Generalizability** (`generalizability_finder.py`): generalizability_finder.py – precision/recall ladder for *generalizability / external validity* statements.
    *   `find_generalizability_v1(text)`
    *   `find_generalizability_v2(text, window=4)`
    *   `find_generalizability_v3(text, block_chars=400)`
    *   `find_generalizability_v4(text, window=12)`
    *   `find_generalizability_v5(text)`
* **Harms Adverse Event** (`harms_adverse_event_finder.py`): harms_adverse_event_finder.py – precision/recall ladder for *harms / adverse events*.
    *   `find_harms_adverse_event_v1(text)`
    *   `find_harms_adverse_event_v2(text, window=4)`
    *   `find_harms_adverse_event_v3(text, block_chars=400)`
    *   `find_harms_adverse_event_v4(text, window=12)`
    *   `find_harms_adverse_event_v5(text)`
* **Healthcare Setting** (`healthcare_setting_finder.py`): healthcare_setting_finder.py – precision/recall ladder for *health‑care setting* statements.
    *   `find_healthcare_setting_v1(text)`
    *   `find_healthcare_setting_v2(text, window=3)`
    *   `find_healthcare_setting_v3(text, block_chars=400)`
    *   `find_healthcare_setting_v4(text, window=12)`
    *   `find_healthcare_setting_v5(text)`
* **Inclusion Rule** (`inclusion_rule_finder.py`): inclusion_rule_finder.py – precision/recall ladder for *inclusion‑rule* statements.
    *   `find_inclusion_rule_v1(text)`
    *   `find_inclusion_rule_v2(text, window=4)`
    *   `find_inclusion_rule_v3(text, block_chars=400)`
    *   `find_inclusion_rule_v4(text, window=12)`
    *   `find_inclusion_rule_v5(text)`
* **Index Date** (`index_date_finder.py`): index_date_finder.py – precision/recall ladder for *index‑date definition* statements.
    *   `find_index_date_v1(text)`
    *   `find_index_date_v2(text, window=4)`
    *   `find_index_date_v3(text, block_chars=400)`
    *   `find_index_date_v4(text, window=12)`
    *   `find_index_date_v5(text)`
* **Interim Analysis Stopping Rules** (`interim_analysis_stopping_rules_finder.py`): interim_analysis_stopping_rules_finder.py – multi-tiered finder for interim analysis stopping rules.
    *   `find_stopping_rule_v1(text)`
    *   `find_stopping_rule_v2(text)`
    *   `find_stopping_rule_v3(text)`
* **Interventions** (`interventions_finder.py`): interventions_finder.py – precision/recall ladder for *interventions / treatments* delivered to study arms.
    *   `find_interventions_v1(text)`
    *   `find_interventions_v2(text, window=4)`
    *   `find_interventions_v3(text, block_chars=400)`
    *   `find_interventions_v4(text, window=12)`
    *   `find_interventions_v5(text)`
* **Limitations** (`limitations_finder.py`): limitations_finder.py – precision/recall ladder for *study limitations* sections.
    *   `find_limitations_v1(text)`
    *   `find_limitations_v2(text, window=4)`
    *   `find_limitations_v3(text, block_chars=400)`
    *   `find_limitations_v4(text, window=12)`
    *   `find_limitations_v5(text)`
* **Losses Exclusion** (`losses_exclusion_finder.py`): losses_exclusion_finder.py – precision/recall ladder for *losses and exclusions after allocation*.
    *   `find_losses_exclusion_v1(text)`
    *   `find_losses_exclusion_v2(text, window=4)`
    *   `find_losses_exclusion_v3(text, block_chars=500)`
    *   `find_losses_exclusion_v4(text, window=12)`
    *   `find_losses_exclusion_v5(text)`
* **Medical Code** (`medical_code_finder.py`): medical_code_finder.py – precision/recall ladder for *medical code* statements.
    *   `find_medical_code_v1(text)`
    *   `find_medical_code_v2(text, window=5)`
    *   `find_medical_code_v3(text, block_chars=300)`
    *   `find_medical_code_v4(text)`
    *   `find_medical_code_v5(text)`
* **Missing Data Handling** (`missing_data_handling_finder.py`): missing_data_handling_finder.py – precision/recall ladder for *missing‑data handling methods*.
    *   `find_missing_data_handling_v1(text)`
    *   `find_missing_data_handling_v2(text, window=4)`
    *   `find_missing_data_handling_v3(text, block_chars=400)`
    *   `find_missing_data_handling_v4(text, window=12)`
    *   `find_missing_data_handling_v5(text)`
* **Numbers Analyzed** (`numbers_analyzed_finder.py`): numbers_analyzed_finder.py – precision/recall ladder for *numbers analysed* in each analysis population.
    *   `find_numbers_analyzed_v1(text)`
    *   `find_numbers_analyzed_v2(text, window=4)`
    *   `find_numbers_analyzed_v3(text, block_chars=400)`
    *   `find_numbers_analyzed_v4(text, window=12)`
    *   `find_numbers_analyzed_v5(text)`
* **Objective Hypothesis** (`objective_hypothesis_finder.py`): objective_hypothesis_finder.py – precision/recall ladder for *study objectives / hypotheses* statements.
    *   `find_objective_hypothesis_v1(text)`
    *   `find_objective_hypothesis_v2(text, window=3)`
    *   `find_objective_hypothesis_v3(text, block_chars=400)`
    *   `find_objective_hypothesis_v4(text, window=12)`
    *   `find_objective_hypothesis_v5(text)`
* **Outcome Ascertainment** (`outcome_ascertainment_finder.py`): outcome_ascertainment_finder.py – precision/recall ladder for *outcome ascertainment* statements.
    *   `find_outcome_ascertainment_v1(text)`
    *   `find_outcome_ascertainment_v2(text, window=4)`
    *   `find_outcome_ascertainment_v3(text, block_chars=400)`
    *   `find_outcome_ascertainment_v4(text, window=12)`
    *   `find_outcome_ascertainment_v5(text)`
* **Outcome Definition** (`outcome_definition_finder.py`): outcome_definition_finder.py – precision/recall ladder for *outcome definition* statements.
    *   `find_outcome_definition_v1(text)`
    *   `find_outcome_definition_v2(text, window=4)`
    *   `find_outcome_definition_v3(text, block_chars=400)`
    *   `find_outcome_definition_v4(text, window=12)`
    *   `find_outcome_definition_v5(text)`
* **Outcome Endpoints** (`outcome_endpoints_finder.py`): outcome_endpoints_finder.py – precision/recall ladder for *primary and secondary outcomes / endpoints* statements.
    *   `find_outcome_endpoints_v1(text)`
    *   `find_outcome_endpoints_v2(text, window=4)`
    *   `find_outcome_endpoints_v3(text, block_chars=500)`
    *   `find_outcome_endpoints_v4(text, window=12)`
    *   `find_outcome_endpoints_v5(text)`
* **Participant Flow** (`participant_flow_finder.py`): participant_flow_finder.py – precision/recall ladder for *participant flow* statements (CONSORT flow).
    *   `find_participant_flow_v1(text)`
    *   `find_participant_flow_v2(text, window=4)`
    *   `find_participant_flow_v3(text, block_chars=600)`
    *   `find_participant_flow_v4(text, window=12)`
    *   `find_participant_flow_v5(text)`
* **Propensity Score Method** (`propensity_score_method_finder.py`): propensity_score_method_finder.py – precision/recall ladder for *propensity-score methods*.
    *   `find_propensity_score_method_v1(text)`
    *   `find_propensity_score_method_v2(text, window=4)`
    *   `find_propensity_score_method_v3(text, block_chars=400)`
    *   `find_propensity_score_method_v4(text, window=12)`
    *   `find_propensity_score_method_v5(text)`
* **Random Sequence Generation** (`random_sequence_generation_finder.py`): random_sequence_generation_finder.py – precision/recall ladder for *random allocation-sequence generation* methods.
    *   `find_random_sequence_generation_v1(text)`
    *   `find_random_sequence_generation_v2(text, window=4)`
    *   `find_random_sequence_generation_v3(text, block_chars=400)`
    *   `find_random_sequence_generation_v4(text, window=12)`
    *   `find_random_sequence_generation_v5(text)`
* **Randomization Implementation** (`randomization_implementation_finder.py`): randomization_implementation_finder.py – precision/recall ladder for *randomization implementation* (who generated sequence, who enrolled, who assigned).
    *   `find_randomization_implementation_v1(text)`
    *   `find_randomization_implementation_v2(text, window=4)`
    *   `find_randomization_implementation_v3(text, block_chars=500)`
    *   `find_randomization_implementation_v4(text, window=12)`
    *   `find_randomization_implementation_v5(text)`
* **Randomization Type Restriction** (`randomization_type_restriction_finder.py`): randomization_type_restriction_finder.py – precision/recall ladder for *randomization type / restrictions* (blocking, stratification, ratio).
    *   `find_randomization_type_restriction_v1(text)`
    *   `find_randomization_type_restriction_v2(text, window=4)`
    *   `find_randomization_type_restriction_v3(text, block_chars=400)`
    *   `find_randomization_type_restriction_v4(text, window=12)`
    *   `find_randomization_type_restriction_v5(text)`
* **Recruitment Timeline** (`recruitment_timeline_finder.py`): recruitment_timeline_finder.py – precision/recall ladder for *recruitment period / timeline*.
    *   `find_recruitment_timeline_v1(text)`
    *   `find_recruitment_timeline_v2(text, window=4)`
    *   `find_recruitment_timeline_v3(text, block_chars=500)`
    *   `find_recruitment_timeline_v4(text, window=12)`
    *   `find_recruitment_timeline_v5(text)`
* **Risk Of Bias Assessment** (`risk_of_bias_assessment_finder.py`): risk_of_bias_assessment_finder.py – precision/recall ladder for *risk‑of‑bias assessments* in systematic reviews.
    *   `find_risk_of_bias_assessment_v1(text)`
    *   `find_risk_of_bias_assessment_v2(text, window=4)`
    *   `find_risk_of_bias_assessment_v3(text, block_chars=400)`
    *   `find_risk_of_bias_assessment_v4(text, window=12)`
    *   `find_risk_of_bias_assessment_v5(text)`
* **Sensitivity Analysis** (`sensitivity_analysis_finder.py`): sensitivity_analysis_finder.py – precision/recall ladder for *sensitivity analysis* statements.
    *   `find_sensitivity_analysis_v1(text)`
    *   `find_sensitivity_analysis_v2(text, window=4)`
    *   `find_sensitivity_analysis_v3(text, block_chars=400)`
    *   `find_sensitivity_analysis_v4(text, window=12)`
    *   `find_sensitivity_analysis_v5(text)`
* **Settings Locations** (`settings_locations_finder.py`): settings_locations_finder.py – precision/recall ladder for *study settings / locations*
    *   `find_settings_locations_v1(text)`
    *   `find_settings_locations_v2(text, window=4)`
    *   `find_settings_locations_v3(text, block_chars=400)`
    *   `find_settings_locations_v4(text, window=12)`
    *   `find_settings_locations_v5(text)`
* **Severity Definition** (`severity_definition_finder.py`): severity_definition_finder.py – precision/recall ladder for *severity definition* statements.
    *   `find_severity_definition_v1(text)`
    *   `find_severity_definition_v2(text, window=4)`
    *   `find_severity_definition_v3(text, block_chars=400)`
    *   `find_severity_definition_v4(text, window=12)`
    *   `find_severity_definition_v5(text)`
* **Similarity Of Interventions** (`similarity_of_interventions_finder.py`): similarity_of_interventions_finder.py – precision/recall ladder for *similarity of interventions*.
    *   `find_similarity_of_interventions_v1(text)`
    *   `find_similarity_of_interventions_v2(text, window=4)`
    *   `find_similarity_of_interventions_v3(text, block_chars=400)`
    *   `find_similarity_of_interventions_v4(text, window=12)`
    *   `find_similarity_of_interventions_v5(text)`
* **Statistical Analysis Additional Method** (`statistical_analysis_additional_method_finder.py`): statistical_analysis_additional_method_finder.py – precision/recall ladder for *statistical methods of additional analyses* (secondary, subgroup, exploratory).
    *   `find_statistical_analysis_additional_method_v1(text)`
    *   `find_statistical_analysis_additional_method_v2(text, window=4)`
    *   `find_statistical_analysis_additional_method_v3(text, block_chars=500)`
    *   `find_statistical_analysis_additional_method_v4(text, window=12)`
    *   `find_statistical_analysis_additional_method_v5(text)`
* **Statistical Analysis** (`statistical_analysis_finder.py`): statistical_analysis_finder.py – precision/recall ladder for *statistical analysis* statements.
    *   `find_statistical_analysis_v1(text)`
    *   `find_statistical_analysis_v2(text, window=4)`
    *   `find_statistical_analysis_v3(text, block_chars=300)`
    *   `find_statistical_analysis_v4(text, window=6)`
    *   `find_statistical_analysis_v5(text)`
* **Statistical Analysis Primary Analysis** (`statistical_analysis_primary_analysis_finder.py`): statistical_analysis_primary_analysis_finder.py – precision/recall ladder for *statistical methods of the primary analysis*.
    *   `find_statistical_analysis_primary_analysis_v1(text)`
    *   `find_statistical_analysis_primary_analysis_v2(text, window=4)`
    *   `find_statistical_analysis_primary_analysis_v3(text, block_chars=500)`
    *   `find_statistical_analysis_primary_analysis_v4(text, window=12)`
    *   `find_statistical_analysis_primary_analysis_v5(text)`
* **Study Design** (`study_design_finder.py`): study_design_finder.py – precision/recall ladder for *study design* declarations.
    *   `find_study_design_v1(text)`
    *   `find_study_design_v2(text, window=4)`
    *   `find_study_design_v3(text, block_chars=400)`
    *   `find_study_design_v4(text, window=12)`
    *   `find_study_design_v5(text)`
* **Study Period** (`study_period_finder.py`): study_period_finder.py – precision/recall ladder for *study period* calendar windows.
    *   `find_study_period_v1(text)`
    *   `find_study_period_v2(text, window=4)`
    *   `find_study_period_v3(text, block_chars=400)`
    *   `find_study_period_v4(text, window=12)`
    *   `find_study_period_v5(text)`
* **Subgroup Analysis** (`subgroup_analysis_finder.py`): subgroup_analysis_finder.py – precision/recall ladder for *subgroup / interaction analyses*.
    *   `find_subgroup_analysis_v1(text)`
    *   `find_subgroup_analysis_v2(text, window=4)`
    *   `find_subgroup_analysis_v3(text, block_chars=400)`
    *   `find_subgroup_analysis_v4(text, window=12)`
    *   `find_subgroup_analysis_v5(text)`
* **Treatment Definition** (`treatment_definition_finder.py`): treatment_definition_finder.py – precision/recall ladder for *treatment definition* statements.
    *   `find_treatment_definition_v1(text)`
    *   `find_treatment_definition_v2(text, window=4)`
    *   `find_treatment_definition_v3(text, block_chars=400)`
    *   `find_treatment_definition_v4(text, window=12)`
    *   `find_treatment_definition_v5(text)`
* **Trial Design Changes** (`trial_design_changes_finder.py`): trial_design_changes_finder.py – precision/recall ladder for *changes to trial design/protocol* after initiation.
    *   `find_trial_design_changes_v1(text)`
    *   `find_trial_design_changes_v2(text, window=4)`
    *   `find_trial_design_changes_v3(text, block_chars=400)`
    *   `find_trial_design_changes_v4(text, window=12)`
    *   `find_trial_design_changes_v5(text)`
* **Trial Design** (`trial_design_finder.py`): trial_design_finder.py – precision/recall ladder for *clinical/epidemiological trial or study design* statements.
    *   `find_trial_design_v1(text)`
    *   `find_trial_design_v2(text, window=4)`
    *   `find_trial_design_v3(text, block_chars=400)`
    *   `find_trial_design_v4(text, window=12)`
    *   `find_trial_design_v5(text)`
* **Trial Registration** (`trial_registration_finder.py`): trial_registration_finder.py – precision/recall ladder for *prospective trial registration* statements.
    *   `find_trial_registration_v1(text)`
    *   `find_trial_registration_v2(text, window=4)`
    *   `find_trial_registration_v3(text, block_chars=400)`
    *   `find_trial_registration_v4(text, window=12)`
    *   `find_trial_registration_v5(text)`
* **Washout Period** (`washout_period_finder.py`): washout_period_finder.py – precision/recall ladder for *washout period* definitions.
    *   `find_washout_period_v1(text)`
    *   `find_washout_period_v2(text, window=4)`
    *   `find_washout_period_v3(text, block_chars=400)`
    *   `find_washout_period_v4(text, window=12)`
    *   `find_washout_period_v5(text)`

## Usage

### Finder Functions

Each `*_finder.py` module contains finder functions that return a list of tuples, where each tuple contains the start and end character indices of a match and the matched string itself.

For example, the `adherence_compliance_finder.py` module contains functions to find mentions of treatment adherence or compliance. The functions are named `find_adherence_compliance_v1` through `find_adherence_compliance_v5`, where `v1` is a high-recall version and `v5` is a high-precision version.

Here's an example of how to use one of these functions:

```python
from pyregularexpression.adherence_compliance_finder import find_adherence_compliance_v1

text = "The study measured adherence to the new drug. Adherence was defined as PDC > 0.8."

matches = find_adherence_compliance_v1(text)

for start, end, snippet in matches:
    print(f"Found '{snippet}' at indices {start}-{end}")
```

### Example: Finding Medical Codes

Here is an example of how to use the `medical_code_finder` to extract potential medical codes from a piece of text.

```python
from pyregularexpression.medical_code_finder import find_medical_code_v1

text = "The patient was diagnosed with ICD-10 code I21.0, which is an acute myocardial infarction. The CPT code was 99285."

matches = find_medical_code_v1(text)

for start, end, snippet in matches:
    print(f"Found medical code: {snippet}")

```

### Helper Functions

The package also includes helper functions to apply multiple finder functions at once.

#### `apply_regex_funcs`

This function applies a list of finder functions to a text and returns a dictionary of the results.

```python
from pyregularexpression.apply_regex_functions import apply_regex_funcs
from pyregularexpression.adherence_compliance_finder import find_adherence_compliance_v1
from pyregularexpression.algorithm_validation_finder import find_algorithm_validation_v1

text = "The study measured adherence to the new drug. The algorithm was validated."

results = apply_regex_funcs(text, [find_adherence_compliance_v1, find_algorithm_validation_v1])

print(results)
```

#### `extract_regex_paragraphs_udf`

This function returns a Spark UDF that can be used to extract paragraphs from a text that match any of a list of finder functions.

```python
from pyspark.sql import SparkSession
from pyregularexpression.extract_regex_paragraphs_udf import extract_regex_paragraphs_udf
from pyregularexpression.adherence_compliance_finder import find_adherence_compliance_v1
from pyregularexpression.algorithm_validation_finder import find_algorithm_validation_v1

spark = SparkSession.builder.getOrCreate()

data = [("The study measured adherence to the new drug.\n\nThe algorithm was validated.",)]
df = spark.createDataFrame(data, ["text"])

udf = extract_regex_paragraphs_udf([find_adherence_compliance_v1, find_algorithm_validation_v1])

df.withColumn("matched_paragraphs", udf(df["text"])).show()
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "pyregularexpression",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "regex, regular expressions, patterns",
    "author": null,
    "author_email": "Gowtham Rao <rao@ohdsi.org>",
    "download_url": "https://files.pythonhosted.org/packages/d2/e9/5cbac0dd9844fb4ebcb82fe56ffc84333a7e2e62b95e85548e9763281012/pyregularexpression-0.1.0.tar.gz",
    "platform": null,
    "description": "# pyRegularExpression\n\nThis package provides a collection of regular expression-based functions to identify and extract components of the scientific process from text. These components include things like identifying if a text discusses adherence, compliance, eligibility criteria, and more.\n\n## Installation\n\n```bash\npip install pyregularexpression\n```\n\n## Available Finder Modules\n\nThis package contains a number of finder modules, each designed to find a specific concept in a text. Each module contains one or more functions that implement different versions of a regular expression with varying levels of precision and recall.\n\nBelow is a list of the available finder modules and their purpose:\n\n* **Adherence Compliance** (`adherence_compliance_finder.py`): adherence_compliance_finder.py \u2013 precision/recall ladder for *treatment adherence / compliance* metrics.\n    *   `find_adherence_compliance_v1(text)`\n    *   `find_adherence_compliance_v2(text, window=4)`\n    *   `find_adherence_compliance_v3(text, block_chars=400)`\n    *   `find_adherence_compliance_v4(text, window=12)`\n    *   `find_adherence_compliance_v5(text)`\n* **Algorithm Validation** (`algorithm_validation_finder.py`): algorithm_validation_finder.py \u2013 precision/recall ladder for *algorithm validation* statements.\n    *   `find_algorithm_validation_v1(text)`\n    *   `find_algorithm_validation_v2(text, window=4)`\n    *   `find_algorithm_validation_v3(text, block_chars=400)`\n    *   `find_algorithm_validation_v4(text, window=12)`\n    *   `find_algorithm_validation_v5(text)`\n* **Allocation Concealment** (`allocation_concealment_finder.py`): allocation_concealment_finder.py \u2013 precision/recall ladder for *allocation concealment* methods.\n    *   `find_allocation_concealment_v1(text)`\n    *   `find_allocation_concealment_v2(text, window=4)`\n    *   `find_allocation_concealment_v3(text, block_chars=400)`\n    *   `find_allocation_concealment_v4(text, window=12)`\n    *   `find_allocation_concealment_v5(text)`\n* **Attrition Criteria** (`attrition_criteria_finder.py`): attrition_criteria_finder.py \u2013 precision/recall ladder for *attrition criteria* (post\u2011enrolment loss).\n    *   `find_attrition_criteria_v1(text)`\n    *   `find_attrition_criteria_v2(text, window=4)`\n    *   `find_attrition_criteria_v3(text, block_chars=400)`\n    *   `find_attrition_criteria_v4(text, window=12)`\n    *   `find_attrition_criteria_v5(text)`\n* **Background Rationale** (`background_rationale_finder.py`): background_rationale_finder.py \u2013 precision/recall ladder for *study background / rationale* statements.\n    *   `find_background_rationale_v1(text)`\n    *   `find_background_rationale_v2(text, window=4)`\n    *   `find_background_rationale_v3(text, block_chars=500)`\n    *   `find_background_rationale_v4(text, window=12)`\n    *   `find_background_rationale_v5(text)`\n* **Baseline Data** (`baseline_data_finder.py`): baseline_data_finder.py \u2013 precision/recall ladder for *baseline participant characteristics*.\n    *   `find_baseline_data_v1(text)`\n    *   `find_baseline_data_v2(text, window=4)`\n    *   `find_baseline_data_v3(text, block_chars=400)`\n    *   `find_baseline_data_v4(text, window=12)`\n    *   `find_baseline_data_v5(text)`\n* **Blinding Masking** (`blinding_masking_finder.py`): blinding_masking_finder.py \u2013 precision/recall ladder for *blinding / masking* status.\n    *   `find_blinding_masking_v1(text)`\n    *   `find_blinding_masking_v2(text, window=4)`\n    *   `find_blinding_masking_v3(text, block_chars=400)`\n    *   `find_blinding_masking_v4(text, window=12)`\n    *   `find_blinding_masking_v5(text)`\n* **Changes To Outcomes** (`changes_to_outcomes_finder.py`): changes_to_outcomes_finder.py \u2013 precision/recall ladder for *changes to prespecified outcomes after trial initiation*.\n    *   `find_changes_to_outcomes_v1(text)`\n    *   `find_changes_to_outcomes_v2(text, window=4)`\n    *   `find_changes_to_outcomes_v3(text, block_chars=400)`\n    *   `find_changes_to_outcomes_v4(text, window=12)`\n    *   `find_changes_to_outcomes_v5(text)`\n* **Comparator Cohort** (`comparator_cohort_finder.py`): comparator_cohort_finder.py \u2013 precision/recall ladder for *comparator (control) cohort* statements.\n    *   `find_comparator_cohort_v1(text)`\n    *   `find_comparator_cohort_v2(text, window=4)`\n    *   `find_comparator_cohort_v3(text, block_chars=400)`\n    *   `find_comparator_cohort_v4(text, window=12)`\n    *   `find_comparator_cohort_v5(text)`\n* **Competing Risk Analysis** (`competing_risk_analysis_finder.py`): competing_risk_analysis_finder.py \u2013 precision/recall ladder for *competing\u2011risk analyses*.\n    *   `find_competing_risk_analysis_v1(text)`\n    *   `find_competing_risk_analysis_v2(text, window=4)`\n    *   `find_competing_risk_analysis_v3(text, block_chars=400)`\n    *   `find_competing_risk_analysis_v4(text, window=12)`\n    *   `find_competing_risk_analysis_v5(text)`\n* **Conflict Of Interest** (`conflict_of_interest_finder.py`): conflict_of_interest_finder.py \u2013 precision/recall ladder for *conflict\u2011of\u2011interest disclosures*.\n    *   `find_conflict_of_interest_v1(text)`\n    *   `find_conflict_of_interest_v2(text, window=4)`\n    *   `find_conflict_of_interest_v3(text, block_chars=400)`\n    *   `find_conflict_of_interest_v4(text, window=12)`\n    *   `find_conflict_of_interest_v5(text)`\n* **Covariate Adjustment** (`covariate_adjustment_finder.py`): covariate_adjustment_finder.py \u2013 precision/recall ladder for *covariate adjustment* statements.\n    *   `find_covariate_adjustment_v1(text)`\n    *   `find_covariate_adjustment_v2(text, window=4)`\n    *   `find_covariate_adjustment_v3(text, block_chars=300)`\n    *   `find_covariate_adjustment_v4(text, window=6)`\n    *   `find_covariate_adjustment_v5(text)`\n* **Data Access** (`data_access_finder.py`): data_access_finder.py \u2013 precision/recall ladder for *data\u2011access / availability* statements.\n    *   `find_data_access_v1(text)`\n    *   `find_data_access_v2(text, window=3)`\n    *   `find_data_access_v3(text, block_chars=400)`\n    *   `find_data_access_v4(text, window=12)`\n    *   `find_data_access_v5(text)`\n* **Data Linkage Method** (`data_linkage_method_finder.py`): data_linkage_method_finder.py \u2013 precision/recall ladder for *data\u2011linkage methods*.\n    *   `find_data_linkage_method_v1(text)`\n    *   `find_data_linkage_method_v2(text, window=3)`\n    *   `find_data_linkage_method_v3(text, block_chars=400)`\n    *   `find_data_linkage_method_v4(text, window=12)`\n    *   `find_data_linkage_method_v5(text)`\n* **Data Provenance** (`data_provenance_finder.py`): data_provenance_finder.py \u2013 precision/recall ladder for *data provenance*\n    *   `find_data_provenance_v1(text)`\n    *   `find_data_provenance_v2(text, window=4)`\n    *   `find_data_provenance_v3(text, block_chars=400)`\n    *   `find_data_provenance_v4(text, window=12)`\n    *   `find_data_provenance_v5(text)`\n* **Data Safety Monitoring** (`data_safety_monitoring_finder.py`): data_safety_monitoring_finder.py \u2013 precision/recall ladder for *Data\u2011Safety Monitoring* descriptions.\n    *   `find_data_safety_monitoring_v1(text)`\n    *   `find_data_safety_monitoring_v2(text, window=4)`\n    *   `find_data_safety_monitoring_v3(text, block_chars=400)`\n    *   `find_data_safety_monitoring_v4(text, window=12)`\n    *   `find_data_safety_monitoring_v5(text)`\n* **Data Sharing Statement** (`data_sharing_statement_finder.py`): data_sharing_statement_finder.py \u2013 precision/recall ladder for *data\u2011sharing statements*.\n    *   `find_data_sharing_statement_v1(text)`\n    *   `find_data_sharing_statement_v2(text, window=4)`\n    *   `find_data_sharing_statement_v3(text, block_chars=400)`\n    *   `find_data_sharing_statement_v4(text, window=12)`\n    *   `find_data_sharing_statement_v5(text)`\n* **Data Source Type** (`data_source_type_finder.py`): data_source_type_finder.py \u2013 precision/recall ladder for *data\u2011source type* declarations.\n    *   `find_data_source_type_v1(text)`\n    *   `find_data_source_type_v2(text, window=2)`\n    *   `find_data_source_type_v3(text, block_chars=400)`\n    *   `find_data_source_type_v4(text, window=12)`\n    *   `find_data_source_type_v5(text)`\n* **Demographic Restriction** (`demographic_restriction_finder.py`): demographic_restriction_finder.py \u2013 precision/recall ladder for demographic\u2011restriction statements.\n    *   `find_demographic_restriction_v1(text)`\n    *   `find_demographic_restriction_v2(text, window=4)`\n    *   `find_demographic_restriction_v3(text, block_chars=400)`\n    *   `find_demographic_restriction_v4(text, window=12)`\n    *   `find_demographic_restriction_v5(text)`\n* **Dose Response Analysis** (`dose_response_analysis_finder.py`): dose_response_analysis_finder.py \u2013 precision/recall ladder for *dose\u2011response / exposure\u2011response analyses*.\n    *   `find_dose_response_analysis_v1(text)`\n    *   `find_dose_response_analysis_v2(text, window=4)`\n    *   `find_dose_response_analysis_v3(text, block_chars=400)`\n    *   `find_dose_response_analysis_v4(text, window=12)`\n    *   `find_dose_response_analysis_v5(text)`\n* **Eligibility Criteria** (`eligibility_criteria_finder.py`): eligibility_criteria_finder.py \u2013 precision/recall ladder for *inclusion / exclusion eligibility criteria* statements.\n    *   `find_eligibility_criteria_v1(text)`\n    *   `find_eligibility_criteria_v2(text, window=4)`\n    *   `find_eligibility_criteria_v3(text, block_chars=500)`\n    *   `find_eligibility_criteria_v4(text, window=12)`\n    *   `find_eligibility_criteria_v5(text)`\n* **Entry Event** (`entry_event_finder.py`): entry_event_finder.py \u2013 precision/recall ladder for *entry\u2011event* statements.\n    *   `find_entry_event_v1(text)`\n    *   `find_entry_event_v2(text, window=4)`\n    *   `find_entry_event_v3(text, block_chars=400)`\n    *   `find_entry_event_v4(text, window=12)`\n    *   `find_entry_event_v5(text)`\n* **Ethics Approval** (`ethics_approval_finder.py`): ethics_approval_finder.py \u2013 precision/recall ladder for *ethics approval & consent* statements.\n    *   `find_ethics_approval_v1(text)`\n    *   `find_ethics_approval_v2(text, window=4)`\n    *   `find_ethics_approval_v3(text, block_chars=400)`\n    *   `find_ethics_approval_v4(text, window=12)`\n    *   `find_ethics_approval_v5(text)`\n* **Event Adjudication** (`event_adjudication_finder.py`): event_adjudication_finder.py \u2013 precision/recall ladder for *event\u2011adjudication descriptions*.\n    *   `find_event_adjudication_v1(text)`\n    *   `find_event_adjudication_v2(text, window=5)`\n    *   `find_event_adjudication_v3(text, block_chars=400)`\n    *   `find_event_adjudication_v4(text, window=12)`\n    *   `find_event_adjudication_v5(text)`\n* **Exclusion Rule** (`exclusion_rule_finder.py`): exclusion_rule_finder.py \u2013 precision/recall ladder for *exclusion\u2011rule* statements.\n    *   `find_exclusion_rule_v1(text)`\n    *   `find_exclusion_rule_v2(text, window=4)`\n    *   `find_exclusion_rule_v3(text, block_chars=400)`\n    *   `find_exclusion_rule_v4(text, window=12)`\n    *   `find_exclusion_rule_v5(text)`\n* **Exit Criterion** (`exit_criterion_finder.py`): exit_criterion_finder.py \u2013 precision/recall ladder for *exit-criterion* statements.\n    *   `find_exit_criterion_v1(text)`\n    *   `find_exit_criterion_v2(text, window=4)`\n    *   `find_exit_criterion_v3(text, block_chars=400)`\n    *   `find_exit_criterion_v4(text, window=12)`\n    *   `find_exit_criterion_v5(text)`\n* **Exposure Definition** (`exposure_definition_finder.py`): exposure_definition_finder.py \u2013 precision/recall ladder for *exposure definition* statements.\n    *   `find_exposure_definition_v1(text)`\n    *   `find_exposure_definition_v2(text, window=4)`\n    *   `find_exposure_definition_v3(text, block_chars=400)`\n    *   `find_exposure_definition_v4(text, window=12)`\n    *   `find_exposure_definition_v5(text)`\n* **Follow Up Period** (`follow_up_period_finder.py`): follow_up_period_finder.py \u2013 precision/recall ladder for *follow\u2011up period* definitions.\n    *   `find_follow_up_period_v1(text)`\n    *   `find_follow_up_period_v2(text, window=4)`\n    *   `find_follow_up_period_v3(text, block_chars=400)`\n    *   `find_follow_up_period_v4(text, window=12)`\n    *   `find_follow_up_period_v5(text)`\n* **Funding Statement** (`funding_statement_finder.py`): funding_statement_finder.py \u2013 precision/recall ladder for *study funding statements*.\n    *   `find_funding_statement_v1(text)`\n    *   `find_funding_statement_v2(text, window=4)`\n    *   `find_funding_statement_v3(text, block_chars=400)`\n    *   `find_funding_statement_v4(text, window=12)`\n    *   `find_funding_statement_v5(text)`\n* **Generalizability** (`generalizability_finder.py`): generalizability_finder.py \u2013 precision/recall ladder for *generalizability / external validity* statements.\n    *   `find_generalizability_v1(text)`\n    *   `find_generalizability_v2(text, window=4)`\n    *   `find_generalizability_v3(text, block_chars=400)`\n    *   `find_generalizability_v4(text, window=12)`\n    *   `find_generalizability_v5(text)`\n* **Harms Adverse Event** (`harms_adverse_event_finder.py`): harms_adverse_event_finder.py \u2013 precision/recall ladder for *harms / adverse events*.\n    *   `find_harms_adverse_event_v1(text)`\n    *   `find_harms_adverse_event_v2(text, window=4)`\n    *   `find_harms_adverse_event_v3(text, block_chars=400)`\n    *   `find_harms_adverse_event_v4(text, window=12)`\n    *   `find_harms_adverse_event_v5(text)`\n* **Healthcare Setting** (`healthcare_setting_finder.py`): healthcare_setting_finder.py \u2013 precision/recall ladder for *health\u2011care setting* statements.\n    *   `find_healthcare_setting_v1(text)`\n    *   `find_healthcare_setting_v2(text, window=3)`\n    *   `find_healthcare_setting_v3(text, block_chars=400)`\n    *   `find_healthcare_setting_v4(text, window=12)`\n    *   `find_healthcare_setting_v5(text)`\n* **Inclusion Rule** (`inclusion_rule_finder.py`): inclusion_rule_finder.py \u2013 precision/recall ladder for *inclusion\u2011rule* statements.\n    *   `find_inclusion_rule_v1(text)`\n    *   `find_inclusion_rule_v2(text, window=4)`\n    *   `find_inclusion_rule_v3(text, block_chars=400)`\n    *   `find_inclusion_rule_v4(text, window=12)`\n    *   `find_inclusion_rule_v5(text)`\n* **Index Date** (`index_date_finder.py`): index_date_finder.py \u2013 precision/recall ladder for *index\u2011date definition* statements.\n    *   `find_index_date_v1(text)`\n    *   `find_index_date_v2(text, window=4)`\n    *   `find_index_date_v3(text, block_chars=400)`\n    *   `find_index_date_v4(text, window=12)`\n    *   `find_index_date_v5(text)`\n* **Interim Analysis Stopping Rules** (`interim_analysis_stopping_rules_finder.py`): interim_analysis_stopping_rules_finder.py \u2013 multi-tiered finder for interim analysis stopping rules.\n    *   `find_stopping_rule_v1(text)`\n    *   `find_stopping_rule_v2(text)`\n    *   `find_stopping_rule_v3(text)`\n* **Interventions** (`interventions_finder.py`): interventions_finder.py \u2013 precision/recall ladder for *interventions / treatments* delivered to study arms.\n    *   `find_interventions_v1(text)`\n    *   `find_interventions_v2(text, window=4)`\n    *   `find_interventions_v3(text, block_chars=400)`\n    *   `find_interventions_v4(text, window=12)`\n    *   `find_interventions_v5(text)`\n* **Limitations** (`limitations_finder.py`): limitations_finder.py \u2013 precision/recall ladder for *study limitations* sections.\n    *   `find_limitations_v1(text)`\n    *   `find_limitations_v2(text, window=4)`\n    *   `find_limitations_v3(text, block_chars=400)`\n    *   `find_limitations_v4(text, window=12)`\n    *   `find_limitations_v5(text)`\n* **Losses Exclusion** (`losses_exclusion_finder.py`): losses_exclusion_finder.py \u2013 precision/recall ladder for *losses and exclusions after allocation*.\n    *   `find_losses_exclusion_v1(text)`\n    *   `find_losses_exclusion_v2(text, window=4)`\n    *   `find_losses_exclusion_v3(text, block_chars=500)`\n    *   `find_losses_exclusion_v4(text, window=12)`\n    *   `find_losses_exclusion_v5(text)`\n* **Medical Code** (`medical_code_finder.py`): medical_code_finder.py \u2013 precision/recall ladder for *medical code* statements.\n    *   `find_medical_code_v1(text)`\n    *   `find_medical_code_v2(text, window=5)`\n    *   `find_medical_code_v3(text, block_chars=300)`\n    *   `find_medical_code_v4(text)`\n    *   `find_medical_code_v5(text)`\n* **Missing Data Handling** (`missing_data_handling_finder.py`): missing_data_handling_finder.py \u2013 precision/recall ladder for *missing\u2011data handling methods*.\n    *   `find_missing_data_handling_v1(text)`\n    *   `find_missing_data_handling_v2(text, window=4)`\n    *   `find_missing_data_handling_v3(text, block_chars=400)`\n    *   `find_missing_data_handling_v4(text, window=12)`\n    *   `find_missing_data_handling_v5(text)`\n* **Numbers Analyzed** (`numbers_analyzed_finder.py`): numbers_analyzed_finder.py \u2013 precision/recall ladder for *numbers analysed* in each analysis population.\n    *   `find_numbers_analyzed_v1(text)`\n    *   `find_numbers_analyzed_v2(text, window=4)`\n    *   `find_numbers_analyzed_v3(text, block_chars=400)`\n    *   `find_numbers_analyzed_v4(text, window=12)`\n    *   `find_numbers_analyzed_v5(text)`\n* **Objective Hypothesis** (`objective_hypothesis_finder.py`): objective_hypothesis_finder.py \u2013 precision/recall ladder for *study objectives / hypotheses* statements.\n    *   `find_objective_hypothesis_v1(text)`\n    *   `find_objective_hypothesis_v2(text, window=3)`\n    *   `find_objective_hypothesis_v3(text, block_chars=400)`\n    *   `find_objective_hypothesis_v4(text, window=12)`\n    *   `find_objective_hypothesis_v5(text)`\n* **Outcome Ascertainment** (`outcome_ascertainment_finder.py`): outcome_ascertainment_finder.py \u2013 precision/recall ladder for *outcome ascertainment* statements.\n    *   `find_outcome_ascertainment_v1(text)`\n    *   `find_outcome_ascertainment_v2(text, window=4)`\n    *   `find_outcome_ascertainment_v3(text, block_chars=400)`\n    *   `find_outcome_ascertainment_v4(text, window=12)`\n    *   `find_outcome_ascertainment_v5(text)`\n* **Outcome Definition** (`outcome_definition_finder.py`): outcome_definition_finder.py \u2013 precision/recall ladder for *outcome definition* statements.\n    *   `find_outcome_definition_v1(text)`\n    *   `find_outcome_definition_v2(text, window=4)`\n    *   `find_outcome_definition_v3(text, block_chars=400)`\n    *   `find_outcome_definition_v4(text, window=12)`\n    *   `find_outcome_definition_v5(text)`\n* **Outcome Endpoints** (`outcome_endpoints_finder.py`): outcome_endpoints_finder.py \u2013 precision/recall ladder for *primary and secondary outcomes / endpoints* statements.\n    *   `find_outcome_endpoints_v1(text)`\n    *   `find_outcome_endpoints_v2(text, window=4)`\n    *   `find_outcome_endpoints_v3(text, block_chars=500)`\n    *   `find_outcome_endpoints_v4(text, window=12)`\n    *   `find_outcome_endpoints_v5(text)`\n* **Participant Flow** (`participant_flow_finder.py`): participant_flow_finder.py \u2013 precision/recall ladder for *participant flow* statements (CONSORT flow).\n    *   `find_participant_flow_v1(text)`\n    *   `find_participant_flow_v2(text, window=4)`\n    *   `find_participant_flow_v3(text, block_chars=600)`\n    *   `find_participant_flow_v4(text, window=12)`\n    *   `find_participant_flow_v5(text)`\n* **Propensity Score Method** (`propensity_score_method_finder.py`): propensity_score_method_finder.py \u2013 precision/recall ladder for *propensity-score methods*.\n    *   `find_propensity_score_method_v1(text)`\n    *   `find_propensity_score_method_v2(text, window=4)`\n    *   `find_propensity_score_method_v3(text, block_chars=400)`\n    *   `find_propensity_score_method_v4(text, window=12)`\n    *   `find_propensity_score_method_v5(text)`\n* **Random Sequence Generation** (`random_sequence_generation_finder.py`): random_sequence_generation_finder.py \u2013 precision/recall ladder for *random allocation-sequence generation* methods.\n    *   `find_random_sequence_generation_v1(text)`\n    *   `find_random_sequence_generation_v2(text, window=4)`\n    *   `find_random_sequence_generation_v3(text, block_chars=400)`\n    *   `find_random_sequence_generation_v4(text, window=12)`\n    *   `find_random_sequence_generation_v5(text)`\n* **Randomization Implementation** (`randomization_implementation_finder.py`): randomization_implementation_finder.py \u2013 precision/recall ladder for *randomization implementation* (who generated sequence, who enrolled, who assigned).\n    *   `find_randomization_implementation_v1(text)`\n    *   `find_randomization_implementation_v2(text, window=4)`\n    *   `find_randomization_implementation_v3(text, block_chars=500)`\n    *   `find_randomization_implementation_v4(text, window=12)`\n    *   `find_randomization_implementation_v5(text)`\n* **Randomization Type Restriction** (`randomization_type_restriction_finder.py`): randomization_type_restriction_finder.py \u2013 precision/recall ladder for *randomization type / restrictions* (blocking, stratification, ratio).\n    *   `find_randomization_type_restriction_v1(text)`\n    *   `find_randomization_type_restriction_v2(text, window=4)`\n    *   `find_randomization_type_restriction_v3(text, block_chars=400)`\n    *   `find_randomization_type_restriction_v4(text, window=12)`\n    *   `find_randomization_type_restriction_v5(text)`\n* **Recruitment Timeline** (`recruitment_timeline_finder.py`): recruitment_timeline_finder.py \u2013 precision/recall ladder for *recruitment period / timeline*.\n    *   `find_recruitment_timeline_v1(text)`\n    *   `find_recruitment_timeline_v2(text, window=4)`\n    *   `find_recruitment_timeline_v3(text, block_chars=500)`\n    *   `find_recruitment_timeline_v4(text, window=12)`\n    *   `find_recruitment_timeline_v5(text)`\n* **Risk Of Bias Assessment** (`risk_of_bias_assessment_finder.py`): risk_of_bias_assessment_finder.py \u2013 precision/recall ladder for *risk\u2011of\u2011bias assessments* in systematic reviews.\n    *   `find_risk_of_bias_assessment_v1(text)`\n    *   `find_risk_of_bias_assessment_v2(text, window=4)`\n    *   `find_risk_of_bias_assessment_v3(text, block_chars=400)`\n    *   `find_risk_of_bias_assessment_v4(text, window=12)`\n    *   `find_risk_of_bias_assessment_v5(text)`\n* **Sensitivity Analysis** (`sensitivity_analysis_finder.py`): sensitivity_analysis_finder.py \u2013 precision/recall ladder for *sensitivity analysis* statements.\n    *   `find_sensitivity_analysis_v1(text)`\n    *   `find_sensitivity_analysis_v2(text, window=4)`\n    *   `find_sensitivity_analysis_v3(text, block_chars=400)`\n    *   `find_sensitivity_analysis_v4(text, window=12)`\n    *   `find_sensitivity_analysis_v5(text)`\n* **Settings Locations** (`settings_locations_finder.py`): settings_locations_finder.py \u2013 precision/recall ladder for *study settings / locations*\n    *   `find_settings_locations_v1(text)`\n    *   `find_settings_locations_v2(text, window=4)`\n    *   `find_settings_locations_v3(text, block_chars=400)`\n    *   `find_settings_locations_v4(text, window=12)`\n    *   `find_settings_locations_v5(text)`\n* **Severity Definition** (`severity_definition_finder.py`): severity_definition_finder.py \u2013 precision/recall ladder for *severity definition* statements.\n    *   `find_severity_definition_v1(text)`\n    *   `find_severity_definition_v2(text, window=4)`\n    *   `find_severity_definition_v3(text, block_chars=400)`\n    *   `find_severity_definition_v4(text, window=12)`\n    *   `find_severity_definition_v5(text)`\n* **Similarity Of Interventions** (`similarity_of_interventions_finder.py`): similarity_of_interventions_finder.py \u2013 precision/recall ladder for *similarity of interventions*.\n    *   `find_similarity_of_interventions_v1(text)`\n    *   `find_similarity_of_interventions_v2(text, window=4)`\n    *   `find_similarity_of_interventions_v3(text, block_chars=400)`\n    *   `find_similarity_of_interventions_v4(text, window=12)`\n    *   `find_similarity_of_interventions_v5(text)`\n* **Statistical Analysis Additional Method** (`statistical_analysis_additional_method_finder.py`): statistical_analysis_additional_method_finder.py \u2013 precision/recall ladder for *statistical methods of additional analyses* (secondary, subgroup, exploratory).\n    *   `find_statistical_analysis_additional_method_v1(text)`\n    *   `find_statistical_analysis_additional_method_v2(text, window=4)`\n    *   `find_statistical_analysis_additional_method_v3(text, block_chars=500)`\n    *   `find_statistical_analysis_additional_method_v4(text, window=12)`\n    *   `find_statistical_analysis_additional_method_v5(text)`\n* **Statistical Analysis** (`statistical_analysis_finder.py`): statistical_analysis_finder.py \u2013 precision/recall ladder for *statistical analysis* statements.\n    *   `find_statistical_analysis_v1(text)`\n    *   `find_statistical_analysis_v2(text, window=4)`\n    *   `find_statistical_analysis_v3(text, block_chars=300)`\n    *   `find_statistical_analysis_v4(text, window=6)`\n    *   `find_statistical_analysis_v5(text)`\n* **Statistical Analysis Primary Analysis** (`statistical_analysis_primary_analysis_finder.py`): statistical_analysis_primary_analysis_finder.py \u2013 precision/recall ladder for *statistical methods of the primary analysis*.\n    *   `find_statistical_analysis_primary_analysis_v1(text)`\n    *   `find_statistical_analysis_primary_analysis_v2(text, window=4)`\n    *   `find_statistical_analysis_primary_analysis_v3(text, block_chars=500)`\n    *   `find_statistical_analysis_primary_analysis_v4(text, window=12)`\n    *   `find_statistical_analysis_primary_analysis_v5(text)`\n* **Study Design** (`study_design_finder.py`): study_design_finder.py \u2013 precision/recall ladder for *study design* declarations.\n    *   `find_study_design_v1(text)`\n    *   `find_study_design_v2(text, window=4)`\n    *   `find_study_design_v3(text, block_chars=400)`\n    *   `find_study_design_v4(text, window=12)`\n    *   `find_study_design_v5(text)`\n* **Study Period** (`study_period_finder.py`): study_period_finder.py \u2013 precision/recall ladder for *study period* calendar windows.\n    *   `find_study_period_v1(text)`\n    *   `find_study_period_v2(text, window=4)`\n    *   `find_study_period_v3(text, block_chars=400)`\n    *   `find_study_period_v4(text, window=12)`\n    *   `find_study_period_v5(text)`\n* **Subgroup Analysis** (`subgroup_analysis_finder.py`): subgroup_analysis_finder.py \u2013 precision/recall ladder for *subgroup / interaction analyses*.\n    *   `find_subgroup_analysis_v1(text)`\n    *   `find_subgroup_analysis_v2(text, window=4)`\n    *   `find_subgroup_analysis_v3(text, block_chars=400)`\n    *   `find_subgroup_analysis_v4(text, window=12)`\n    *   `find_subgroup_analysis_v5(text)`\n* **Treatment Definition** (`treatment_definition_finder.py`): treatment_definition_finder.py \u2013 precision/recall ladder for *treatment definition* statements.\n    *   `find_treatment_definition_v1(text)`\n    *   `find_treatment_definition_v2(text, window=4)`\n    *   `find_treatment_definition_v3(text, block_chars=400)`\n    *   `find_treatment_definition_v4(text, window=12)`\n    *   `find_treatment_definition_v5(text)`\n* **Trial Design Changes** (`trial_design_changes_finder.py`): trial_design_changes_finder.py \u2013 precision/recall ladder for *changes to trial design/protocol* after initiation.\n    *   `find_trial_design_changes_v1(text)`\n    *   `find_trial_design_changes_v2(text, window=4)`\n    *   `find_trial_design_changes_v3(text, block_chars=400)`\n    *   `find_trial_design_changes_v4(text, window=12)`\n    *   `find_trial_design_changes_v5(text)`\n* **Trial Design** (`trial_design_finder.py`): trial_design_finder.py \u2013 precision/recall ladder for *clinical/epidemiological trial or study design* statements.\n    *   `find_trial_design_v1(text)`\n    *   `find_trial_design_v2(text, window=4)`\n    *   `find_trial_design_v3(text, block_chars=400)`\n    *   `find_trial_design_v4(text, window=12)`\n    *   `find_trial_design_v5(text)`\n* **Trial Registration** (`trial_registration_finder.py`): trial_registration_finder.py \u2013 precision/recall ladder for *prospective trial registration* statements.\n    *   `find_trial_registration_v1(text)`\n    *   `find_trial_registration_v2(text, window=4)`\n    *   `find_trial_registration_v3(text, block_chars=400)`\n    *   `find_trial_registration_v4(text, window=12)`\n    *   `find_trial_registration_v5(text)`\n* **Washout Period** (`washout_period_finder.py`): washout_period_finder.py \u2013 precision/recall ladder for *washout period* definitions.\n    *   `find_washout_period_v1(text)`\n    *   `find_washout_period_v2(text, window=4)`\n    *   `find_washout_period_v3(text, block_chars=400)`\n    *   `find_washout_period_v4(text, window=12)`\n    *   `find_washout_period_v5(text)`\n\n## Usage\n\n### Finder Functions\n\nEach `*_finder.py` module contains finder functions that return a list of tuples, where each tuple contains the start and end character indices of a match and the matched string itself.\n\nFor example, the `adherence_compliance_finder.py` module contains functions to find mentions of treatment adherence or compliance. The functions are named `find_adherence_compliance_v1` through `find_adherence_compliance_v5`, where `v1` is a high-recall version and `v5` is a high-precision version.\n\nHere's an example of how to use one of these functions:\n\n```python\nfrom pyregularexpression.adherence_compliance_finder import find_adherence_compliance_v1\n\ntext = \"The study measured adherence to the new drug. Adherence was defined as PDC > 0.8.\"\n\nmatches = find_adherence_compliance_v1(text)\n\nfor start, end, snippet in matches:\n    print(f\"Found '{snippet}' at indices {start}-{end}\")\n```\n\n### Example: Finding Medical Codes\n\nHere is an example of how to use the `medical_code_finder` to extract potential medical codes from a piece of text.\n\n```python\nfrom pyregularexpression.medical_code_finder import find_medical_code_v1\n\ntext = \"The patient was diagnosed with ICD-10 code I21.0, which is an acute myocardial infarction. The CPT code was 99285.\"\n\nmatches = find_medical_code_v1(text)\n\nfor start, end, snippet in matches:\n    print(f\"Found medical code: {snippet}\")\n\n```\n\n### Helper Functions\n\nThe package also includes helper functions to apply multiple finder functions at once.\n\n#### `apply_regex_funcs`\n\nThis function applies a list of finder functions to a text and returns a dictionary of the results.\n\n```python\nfrom pyregularexpression.apply_regex_functions import apply_regex_funcs\nfrom pyregularexpression.adherence_compliance_finder import find_adherence_compliance_v1\nfrom pyregularexpression.algorithm_validation_finder import find_algorithm_validation_v1\n\ntext = \"The study measured adherence to the new drug. The algorithm was validated.\"\n\nresults = apply_regex_funcs(text, [find_adherence_compliance_v1, find_algorithm_validation_v1])\n\nprint(results)\n```\n\n#### `extract_regex_paragraphs_udf`\n\nThis function returns a Spark UDF that can be used to extract paragraphs from a text that match any of a list of finder functions.\n\n```python\nfrom pyspark.sql import SparkSession\nfrom pyregularexpression.extract_regex_paragraphs_udf import extract_regex_paragraphs_udf\nfrom pyregularexpression.adherence_compliance_finder import find_adherence_compliance_v1\nfrom pyregularexpression.algorithm_validation_finder import find_algorithm_validation_v1\n\nspark = SparkSession.builder.getOrCreate()\n\ndata = [(\"The study measured adherence to the new drug.\\n\\nThe algorithm was validated.\",)]\ndf = spark.createDataFrame(data, [\"text\"])\n\nudf = extract_regex_paragraphs_udf([find_adherence_compliance_v1, find_algorithm_validation_v1])\n\ndf.withColumn(\"matched_paragraphs\", udf(df[\"text\"])).show()\n```\n",
    "bugtrack_url": null,
    "license": "Apache License\n                                   Version 2.0, January 2004\n                                http://www.apache.org/licenses/\n        \n           TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n        \n           1. Definitions.\n        \n              \"License\" shall mean the terms and conditions for use, reproduction,\n              and distribution as defined by Sections 1 through 9 of this document.\n        \n              \"Licensor\" shall mean the copyright owner or entity authorized by\n              the copyright owner that is granting the License.\n        \n              \"Legal Entity\" shall mean the union of the acting entity and all\n              other entities that control, are controlled by, or are under common\n              control with that entity. For the purposes of this definition,\n              \"control\" means (i) the power, direct or indirect, to cause the\n              direction or management of such entity, whether by contract or\n              otherwise, or (ii) ownership of fifty percent (50%) or more of the\n              outstanding shares, or (iii) beneficial ownership of such entity.\n        \n              \"You\" (or \"Your\") shall mean an individual or Legal Entity\n              exercising permissions granted by this License.\n        \n              \"Source\" form shall mean the preferred form for making modifications,\n              including but not limited to software source code, documentation\n              source, and configuration files.\n        \n              \"Object\" form shall mean any form resulting from mechanical\n              transformation or translation of a Source form, including but\n              not limited to compiled object code, generated documentation,\n              and conversions to other media types.\n        \n              \"Work\" shall mean the work of authorship, whether in Source or\n              Object form, made available under the License, as indicated by a\n              copyright notice that is included in or attached to the work\n              (an example is provided in the Appendix below).\n        \n              \"Derivative Works\" shall mean any work, whether in Source or Object\n              form, that is based on (or derived from) the Work and for which the\n              editorial revisions, annotations, elaborations, or other modifications\n              represent, as a whole, an original work of authorship. For the purposes\n              of this License, Derivative Works shall not include works that remain\n              separable from, or merely link (or bind by name) to the interfaces of,\n              the Work and Derivative Works thereof.\n        \n              \"Contribution\" shall mean any work of authorship, including\n              the original version of the Work and any modifications or additions\n              to that Work or Derivative Works thereof, that is intentionally\n              submitted to Licensor for inclusion in the Work by the copyright owner\n              or by an individual or Legal Entity authorized to submit on behalf of\n              the copyright owner. For the purposes of this definition, \"submitted\"\n              means any form of electronic, verbal, or written communication sent\n              to the Licensor or its representatives, including but not limited to\n              communication on electronic mailing lists, source code control systems,\n              and issue tracking systems that are managed by, or on behalf of, the\n              Licensor for the purpose of discussing and improving the Work, but\n              excluding communication that is conspicuously marked or otherwise\n              designated in writing by the copyright owner as \"Not a Contribution.\"\n        \n              \"Contributor\" shall mean Licensor and any individual or Legal Entity\n              on behalf of whom a Contribution has been received by Licensor and\n              subsequently incorporated within the Work.\n        \n           2. Grant of Copyright License. Subject to the terms and conditions of\n              this License, each Contributor hereby grants to You a perpetual,\n              worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n              copyright license to reproduce, prepare Derivative Works of,\n              publicly display, publicly perform, sublicense, and distribute the\n              Work and such Derivative Works in Source or Object form.\n        \n           3. Grant of Patent License. Subject to the terms and conditions of\n              this License, each Contributor hereby grants to You a perpetual,\n              worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n              (except as stated in this section) patent license to make, have made,\n              use, offer to sell, sell, import, and otherwise transfer the Work,\n              where such license applies only to those patent claims licensable\n              by such Contributor that are necessarily infringed by their\n              Contribution(s) alone or by combination of their Contribution(s)\n              with the Work to which such Contribution(s) was submitted. If You\n              institute patent litigation against any entity (including a\n              cross-claim or counterclaim in a lawsuit) alleging that the Work\n              or a Contribution incorporated within the Work constitutes direct\n              or contributory patent infringement, then any patent licenses\n              granted to You under this License for that Work shall terminate\n              as of the date such litigation is filed.\n        \n           4. Redistribution. You may reproduce and distribute copies of the\n              Work or Derivative Works thereof in any medium, with or without\n              modifications, and in Source or Object form, provided that You\n              meet the following conditions:\n        \n              (a) You must give any other recipients of the Work or\n                  Derivative Works a copy of this License; and\n        \n              (b) You must cause any modified files to carry prominent notices\n                  stating that You changed the files; and\n        \n              (c) You must retain, in the Source form of any Derivative Works\n                  that You distribute, all copyright, patent, trademark, and\n                  attribution notices from the Source form of the Work,\n                  excluding those notices that do not pertain to any part of\n                  the Derivative Works; and\n        \n              (d) If the Work includes a \"NOTICE\" text file as part of its\n                  distribution, then any Derivative Works that You distribute must\n                  include a readable copy of the attribution notices contained\n                  within such NOTICE file, excluding those notices that do not\n                  pertain to any part of the Derivative Works, in at least one\n                  of the following places: within a NOTICE text file distributed\n                  as part of the Derivative Works; within the Source form or\n                  documentation, if provided along with the Derivative Works; or,\n                  within a display generated by the Derivative Works, if and\n                  wherever such third-party notices normally appear. The contents\n                  of the NOTICE file are for informational purposes only and\n                  do not modify the License. You may add Your own attribution\n                  notices within Derivative Works that You distribute, alongside\n                  or as an addendum to the NOTICE text from the Work, provided\n                  that such additional attribution notices cannot be construed\n                  as modifying the License.\n        \n              You may add Your own copyright statement to Your modifications and\n              may provide additional or different license terms and conditions\n              for use, reproduction, or distribution of Your modifications, or\n              for any such Derivative Works as a whole, provided Your use,\n              reproduction, and distribution of the Work otherwise complies with\n              the conditions stated in this License.\n        \n           5. Submission of Contributions. Unless You explicitly state otherwise,\n              any Contribution intentionally submitted for inclusion in the Work\n              by You to the Licensor shall be under the terms and conditions of\n              this License, without any additional terms or conditions.\n              Notwithstanding the above, nothing herein shall supersede or modify\n              the terms of any separate license agreement you may have executed\n              with Licensor regarding such Contributions.\n        \n           6. Trademarks. This License does not grant permission to use the trade\n              names, trademarks, service marks, or product names of the Licensor,\n              except as required for reasonable and customary use in describing the\n              origin of the Work and reproducing the content of the NOTICE file.\n        \n           7. Disclaimer of Warranty. Unless required by applicable law or\n              agreed to in writing, Licensor provides the Work (and each\n              Contributor provides its Contributions) on an \"AS IS\" BASIS,\n              WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n              implied, including, without limitation, any warranties or conditions\n              of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n              PARTICULAR PURPOSE. You are solely responsible for determining the\n              appropriateness of using or redistributing the Work and assume any\n              risks associated with Your exercise of permissions under this License.\n        \n           8. Limitation of Liability. In no event and under no legal theory,\n              whether in tort (including negligence), contract, or otherwise,\n              unless required by applicable law (such as deliberate and grossly\n              negligent acts) or agreed to in writing, shall any Contributor be\n              liable to You for damages, including any direct, indirect, special,\n              incidental, or consequential damages of any character arising as a\n              result of this License or out of the use or inability to use the\n              Work (including but not limited to damages for loss of goodwill,\n              work stoppage, computer failure or malfunction, or any and all\n              other commercial damages or losses), even if such Contributor\n              has been advised of the possibility of such damages.\n        \n           9. Accepting Warranty or Additional Liability. While redistributing\n              the Work or Derivative Works thereof, You may choose to offer,\n              and charge a fee for, acceptance of support, warranty, indemnity,\n              or other liability obligations and/or rights consistent with this\n              License. However, in accepting such obligations, You may act only\n              on Your own behalf and on Your sole responsibility, not on behalf\n              of any other Contributor, and only if You agree to indemnify,\n              defend, and hold each Contributor harmless for any liability\n              incurred by, or claims asserted against, such Contributor by reason\n              of your accepting any such warranty or additional liability.\n        \n           END OF TERMS AND CONDITIONS\n        \n           APPENDIX: How to apply the Apache License to your work.\n        \n              To apply the Apache License to your work, attach the following\n              boilerplate notice, with the fields enclosed by brackets \"[]\"\n              replaced with your own identifying information. (Don't include\n              the brackets!)  The text should be enclosed in the appropriate\n              comment syntax for the file format. We also recommend that a\n              file or class name and description of purpose be included on the\n              same \"printed page\" as the copyright notice for easier\n              identification within third-party archives.\n        \n           Copyright [yyyy] [name of copyright owner]\n        \n           Licensed under the Apache License, Version 2.0 (the \"License\");\n           you may not use this file except in compliance with the License.\n           You may obtain a copy of the License at\n        \n               http://www.apache.org/licenses/LICENSE-2.0\n        \n           Unless required by applicable law or agreed to in writing, software\n           distributed under the License is distributed on an \"AS IS\" BASIS,\n           WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n           See the License for the specific language governing permissions and\n           limitations under the License.\n        ",
    "summary": "Collection of reusable regular\u2011expression patterns",
    "version": "0.1.0",
    "project_urls": {
        "BugTracker": "https://github.com/OHDSI/pyRegularExpression/issues",
        "Homepage": "https://github.com/OHDSI/pyRegularExpression"
    },
    "split_keywords": [
        "regex",
        " regular expressions",
        " patterns"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "ac720c865ed9e432cc4353fc0ac2418a723058e42a9c1e0771f9985d918b7aaa",
                "md5": "e8c7ad61f53447032776575d7b48a564",
                "sha256": "76214ded49bdbdb8f59b6efd240d8a319fb1c0caa0973ff3a1ac4fdaac40b885"
            },
            "downloads": -1,
            "filename": "pyregularexpression-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e8c7ad61f53447032776575d7b48a564",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 165574,
            "upload_time": "2025-09-03T22:33:36",
            "upload_time_iso_8601": "2025-09-03T22:33:36.664096Z",
            "url": "https://files.pythonhosted.org/packages/ac/72/0c865ed9e432cc4353fc0ac2418a723058e42a9c1e0771f9985d918b7aaa/pyregularexpression-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "d2e95cbac0dd9844fb4ebcb82fe56ffc84333a7e2e62b95e85548e9763281012",
                "md5": "38eac9cb07e5cee9dc7ab8daad403309",
                "sha256": "54a2584bb432226437bec6c4f4d73528597d1c73f803e8c22ab43dc353d4d478"
            },
            "downloads": -1,
            "filename": "pyregularexpression-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "38eac9cb07e5cee9dc7ab8daad403309",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 161714,
            "upload_time": "2025-09-03T22:33:38",
            "upload_time_iso_8601": "2025-09-03T22:33:38.396347Z",
            "url": "https://files.pythonhosted.org/packages/d2/e9/5cbac0dd9844fb4ebcb82fe56ffc84333a7e2e62b95e85548e9763281012/pyregularexpression-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-09-03 22:33:38",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "OHDSI",
    "github_project": "pyRegularExpression",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "pyregularexpression"
}
        
Elapsed time: 1.59628s