Skip to content

Commit e551ec9

Browse files
committed
Better example
1 parent 95702b6 commit e551ec9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ The pros are:
6565
- Go's `regexp` package is usually considered immature performance-wise. This proposal plays a small role in fixing that by adding optimizations that can reasonably be expected from the end-user.
6666
- This matcher keeps very little state and bypasses the mutex from `regexp.go`
6767
- There are already 3 different matchers in the standard library (4 with the upcoming DFA), so adding a new one for a specific kind of patterns is not surprising.
68-
- `regexp.MatchString("^ab")` could obviously be rewritten as `strings.HasPrefix("ab")` but sometimes it is not practical because the pattern to be matched is user-supplied or part of a long list of patterns. Examples include interactive log search or lists of paths in HTTP routers.
68+
- `regexp.MatchString("(?:png|jpg)$")` could obviously be rewritten as `strings.HasSuffix("png") or strings.HasSuffix("jpg")` but sometimes it is not practical because the pattern to be matched is user-supplied or part of a long list of patterns. Examples include interactive log search or lists of paths in HTTP routers.
6969
- Limited risk due to exhaustive tests in the standard library and additional fuzzing
7070

7171
Feedback would be highly appreciated!

0 commit comments

Comments
 (0)