Skip to content

Conversation

@BustDot
Copy link
Contributor

@BustDot BustDot commented Aug 29, 2023

@casbin-bot
Copy link
Member

@Nekotoxin please review

@casbin-bot casbin-bot requested a review from Nekotoxin August 29, 2023 15:51
@hsluoyz
Copy link
Member

hsluoyz commented Aug 29, 2023

@leeqvip

re_pattern = r"{[^/]+}"
key2 = re.sub(re_pattern, r"[^/]+", key2)

return regex_match(key1, "^" + key2 + "$")
Copy link
Member

Choose a reason for hiding this comment

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

@BustDot Please pre-compile the regular expression at the beginning of the file to improve efficiency.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Resolved.

@BustDot BustDot requested a review from leeqvip August 30, 2023 03:04
@leeqvip leeqvip merged commit 7d29109 into casbin:master Aug 30, 2023
github-actions bot pushed a commit that referenced this pull request Aug 30, 2023
# [1.25.0](v1.24.0...v1.25.0) (2023-08-30)

### Features

* add key_match5 function for matcher ([#315](#315)) ([7d29109](7d29109))
@github-actions
Copy link

🎉 This PR is included in version 1.25.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@BustDot BustDot deleted the feat/key-match-5 branch August 31, 2023 09:44
Chimou0 pushed a commit to Chimou0/pycasbin that referenced this pull request Jul 17, 2025
Chimou0 pushed a commit to Chimou0/pycasbin that referenced this pull request Jul 17, 2025
# [1.25.0](casbin/pycasbin@v1.24.0...v1.25.0) (2023-08-30)

### Features

* add key_match5 function for matcher ([casbin#315](casbin#315)) ([7d29109](casbin@7d29109))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants