Skip to content

Routing: Add regexp syntax support to UserMatcher#3799

Merged
yuhan6665 merged 1 commit intoXTLS:mainfrom
vnxme:user-regexp-matcher
Sep 12, 2024
Merged

Routing: Add regexp syntax support to UserMatcher#3799
yuhan6665 merged 1 commit intoXTLS:mainfrom
vnxme:user-regexp-matcher

Conversation

@vnxme
Copy link
Contributor

@vnxme vnxme commented Sep 12, 2024

This PR implements regexp syntax support to UserMatcher, i.e. allows to match user email in routing rules with regular expressions using regexp:{pattern} syntax. It has also been requested in #2536.

@APT-ZERO
Copy link

Thank you, it's useful , You can also add support for strings.Contains(), strings.HasPrefix(), strings.HasSuffix() as they are faster and uses less resources
for 'user' and also for 'inboundTag'

@Fangliding
Copy link
Member

最好找时间以一个更统一的方法把这些东西全实现regexp 不然后面如果又有人加然后方法又不一样乱七八糟发

@Fangliding
Copy link
Member

好吧翻了一下也就inbound tag和user可以加 user又是唯一值得加的

@yuhan6665 yuhan6665 merged commit 3a8c5f3 into XTLS:main Sep 12, 2024
@yuhan6665
Copy link
Member

感谢 @vnxme
@APT-ZERO ,regex 已经满足需求 所以不需要再加其他
@Fangliding 是的如果有超过三个地方需要 以后可以考虑 refactor

leninalive pushed a commit to amnezia-vpn/amnezia-xray-core that referenced this pull request Oct 29, 2024
it2konst pushed a commit to it2konst/gametunnel-core that referenced this pull request Mar 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants