-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Convert Go regex to Rust regex (#76)
Convert Go regex to Rust regex Go and Rust have some differences in their regex implementation. In Go the following is valid: ``` uri=~"/v[1-9]/.*/{gid}/{uid}" ``` Rust sees the `{gid}` as a bad repetition, it expects a range like {1,4} ``` regex parse error: /v[1-9]/.*/{gid}/{uid} ^ error: repetition quantifier expects a valid decimal ``` For it to be a valid Rust regex the opening { has to be escaped. This change adds that escaping. The implementation is simple, iteration + writing in a result buffer. It is probably not the best of nicest way of doing it, but it straight forward
- Loading branch information
Showing
2 changed files
with
100 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters