Skip to content
This repository was archived by the owner on Nov 8, 2024. It is now read-only.

[UFC] Use partial instead of full match for regex#37

Merged
schmit merged 3 commits intomainfrom
sps/regex-search-instead-of-match
May 14, 2024
Merged

[UFC] Use partial instead of full match for regex#37
schmit merged 3 commits intomainfrom
sps/regex-search-instead-of-match

Conversation

@schmit
Copy link

@schmit schmit commented May 14, 2024

Motivation and Context

Unlike other SDKs, Python currently uses full match search for regex rather than partial match

Description

Switch to using partial match

How has this been tested?

Updated tests and global tests

@schmit schmit requested a review from aarsilv May 14, 2024 16:22
)


def test_evaluate_condition_matches_partial():
Copy link
Contributor

Choose a reason for hiding this comment

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

🙌

if condition.operator == OperatorType.MATCHES:
return isinstance(condition.value, str) and bool(
re.match(condition.value, str(subject_value))
re.search(condition.value, str(subject_value))
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@schmit schmit merged commit b7ec99b into main May 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants