Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use parameter flags instead of inline flags for regex #109

Merged
merged 1 commit into from
Jan 2, 2024

Conversation

Simon-1-1
Copy link
Contributor

@Simon-1-1 Simon-1-1 commented Nov 16, 2023

Using the (?i) inline flag was deprecated in Python 3.6 and raises an error in 3.11.

Changed to use parameter flags (re.IGNORECASE) instead of inline flags.

Also added a test for the function where the regex is used.

Reference

@Simon-1-1 Simon-1-1 force-pushed the topic/flags-for-regex branch 2 times, most recently from f9f8f6a to a29c432 Compare November 16, 2023 13:38
Using (?i) inside a regex is deprecated. It is still possible to use it
at the start of the regex. I consider it clearer to have the flags as
parameters instead of inside the regex string. So I set the
re.IGNORECASE parameter flag instead.

Also added a test for the function where the regex is used.
@Simon-1-1 Simon-1-1 changed the title Use flags instead of deprecated regex syntax Use parameter flags instead of inline flags for regex Dec 28, 2023
@Simon-1-1 Simon-1-1 added the bug Something isn't working label Dec 28, 2023
@Simon-1-1 Simon-1-1 self-assigned this Dec 28, 2023
@Simon-1-1 Simon-1-1 requested review from Chloe-KK-Yan and removed request for plaos and nberggr1 December 28, 2023 14:54
Copy link

@Chloe-KK-Yan Chloe-KK-Yan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Chloe-KK-Yan Chloe-KK-Yan merged commit 4157b67 into main Jan 2, 2024
6 checks passed
@Chloe-KK-Yan Chloe-KK-Yan deleted the topic/flags-for-regex branch January 2, 2024 08:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants