5 ms·
Yeah I know who you are, that's why I was shocked. That's why I'd have thought you leverage regexes more than other folks, not less! On my end I do this all the
by dataflow 3y ago
Yeah I know who you are, that's why I was shocked. That's why I'd have thought you leverage regexes more than other folks, not less! On my end I do this all the time. E.g., a very common regex search/replace I do over and over is something like removing duplicate lines, e.g. replacing "^(.*)\n\1\n" with "\1\n" repeatedly. (Obviously exact deduplication you can do a different way, but you can imagine variations on it that are case-specific, e.g. removing all lines or table fields that are prefixes of the following ones.) Of course I'm not claiming this is the majority of my searches (literals are obviously far more common like you said), but this kind of stuff comes up quite regularly, on perhaps a ~weekly basis if not more frequently. I'm very surprised you don't do transformations like these!
- burntsushi 3y agoFor that one in particular, nope. The only thing I can think of is when I'm trying to count occurrences of something, but that's just `sort | uniq -c`. I'll note that Discord also uses the regex crate for something to do with automod[1]. It would be interesting to ask their users how often they're annoyed by the lack of look-around or backreferences or some other fancy feature. Although in their case, the linear time guarantee is likely essential to exposing regex support in the first place. [1]: https://support.discord.com/hc/en-us/articles/10069840290711-Filter-Messages-Using-Regular-Expressions-Regex- https://support.discord.com/hc/en-us/articles/10069840290711...