fix: fixed topic regex to make it compatible with golang re2 #254
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
How the regex works ?
[a-fh-zA-Z][a-zA-Z0-9\-._~%+]{0,254}
: Matches if the string starts with any letter except g, followed by 0 to 254 allowed characters (a-zA-Z0-9\-._~%+
).g(...)
: Matches if the string starts with g, and the rest of the string matches one of the nested alternatives:$
: The string is exactly"g"
.[^o][a-zA-Z0-9\-._~%+]{0,253}
: The second character is not o, followed by 0 to 253 allowed characters.o(...)
: The second character is o (starts"go"
), and the rest matches:$
: The string is exactly"go"
.[^o][a-zA-Z0-9\-._~%+]{0,252}
: The third character is not 'o', followed by 0 to 252 allowed characters.o(...)
: The third character is 'o' (starts"goo"
), and the rest matches:$
: The string is exactly"goo"
.[^g][a-zA-Z0-9\-._~%+]{0,251}
: The fourth character is not 'g', followed by 0 to 251 allowed characters.