Skip to content

Conversation

@vaishakhRaveendran
Copy link
Contributor

This PR addresses the "global flags not at the start" error in the RulebasedExtractor class. The merge_extractors function has been updated to handle regex flags correctly when combining multiple extractors.
Fixes #1112
Changes:

Modified merge_extractors to extract flags from the beginning of each pattern
Implemented wrapping of individual patterns in non-capturing groups with their respective flags
Ensured that the merged pattern preserves flags for each subpattern

This fix allows for proper handling of regex flags when merging extractors, preventing the "global flags not at the start" error while maintaining the functionality of individual extractor patterns.

@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Jul 18, 2024
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Jul 22, 2024
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Jul 22, 2024
@jjmachan jjmachan merged commit ffebf4f into explodinggradients:main Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Regular Expression Flag Placement Error in extract_text Method

2 participants