Closed Shawak closed 9 months ago
So I know there is similar logic already to this in the server as it has to be able to resolve a non-wildcard subject to the proper stream/subject. That code is pretty complex. Also, you know more about your subjects and wildcards so could build an efficient function with that knowledge. If you would like, you are welcome to build this and we'll consider adding it to the project.
I'm now using this to solve my issue:
var regex = new Regex($"^{Regex.Escape(subject).Replace(@"\*", "[^.]+").Replace(@">", ".+")}$", RegexOptions.Compiled);
Proposed change
Use case
I ran into a problem where I have to check if the subject I am receiving matches a specific wildcard subject, I searched for a function to check this but I couldnt find any
Contribution
No response