4 ms·
Regular expressions are used less frequently in Go than in many popular languages (esp. dynamic ones). Often the "strings" package suffices. I almost never impo
by bmatsuo 12y ago
Regular expressions are used less frequently in Go than in many popular languages (esp. dynamic ones). Often the "strings" package suffices. I almost never import "regexp". So yea. As people have said, I don't think it's a high priority.
- enneff 12y agoRob wrote about this: http://commandcenter.blogspot.com.au/2011/08/regular-expressions-in-lexing-and.html http://commandcenter.blogspot.com.au/2011/08/regular-express...
- coldtea 12y ago>Often the "strings" package suffices. Suffices for whom and for what work? Maybe suffices for you. This is not a dynamic vs static language issue -- C and C++ users use regexes all the time. It's a matter of business needs (e.g what you need your program to do).
- dchest 12y agoTrue, but there's also another factor: in Go it's easy to write string manipulation functions that are fast, while in most dynamic languages some regular expressions would run faster than your hand-written routine.
- coldtea 12y agoPerhaps, but I'm not 100% about that without some profiling. For one, Go tends to offer string stuff implemented in Go, whereas dynamic languages usually delegate string operations to plain old C, which can be faster (especially when Unicode is added into the picture).