Hacker GitHub

← All repos

rust-lang/regex

View on GitHub ↗ ★ 4,048 Rust

An implementation of regular expressions for Rust. This implementation uses finite automata and guarantees linear time matching on all inputs.

78 mentions on Hacker News by 39 people: 7 stories, 71 comments · first 2015-01-15 · latest 2026-02-20

Mentions per year 78 mentions · busiest year 2017 (14)
20082026
  1. …the crates can only interact along `pub` boundaries). [1]: https://docs.rs/regex/latest/regex/ [2]: https://github.com/rust-lang/regex
    comment by lesuorac · 2026-02-20 · in Farewell, Rust for web
  2. …AFAIR need 3rd party packages: Regex Regex is not 3rd party (note the 'rust-lang' in the URL): https://github.com/rust-lang/regex
    comment by kouteiheika · 2025-05-10 · in Rust’s dependencies are starting to worry me
  3. Yes. I'm the one who implemented the case folding the `fd` uses (via its regex engine). See: https://github.com/rust-lang/regex/blob/master/UNICODE.md#rl... And then Unicode itself for more discussion on the topic:…
  4. …dependencies for critical components (like regex and async). Regex is not a third-party dependency: https://github.com/rust-lang/regex
  5. …To add more color to this, the precise details of what "Unicode support" means are documented here: https://github.com/rust-lang/regex/blob/master/UNICODE.md In effect, all of UTS#18 Level 1 is covered with a couple caveats. This is…
  6. …hitting the z key. Could someone clarify what that means? My interpretation of that was to go to https://github.com/rust-lang/regex/blob/master/regex-cli/arg... and start typing 'z' at the end of line 21, but that doesn't seem to make any…
  7. …"windowing" patterns and does something clever. I have a ticket open for something similar[1]. [1]: https://github.com/rust-lang/regex/issues/802
  8. burntsushi actually regrets making regex replace return a Cow<str>: https://github.com/rust-lang/regex/issues/676#issuecomment-6... . I’m glad it does, and wish it took an impl Into<Cow<str>> there, for the reasons discussed in the issue,…
    comment by chrismorgan · 2023-12-05 · in Common Rust Lifetime Misconceptions (2020)
  9. …[2]: https://docs.rs/regex-automata/latest/regex_automata/meta/st... [3]: https://github.com/rust-lang/regex/blob/837fd85e79fac2a4ea64...
    comment by burntsushi · 2023-12-01 · in Advent of Code 2023 is nigh
  10. It’s not quite that simple, but folks are working on it. https://github.com/rust-lang/regex/issues/425#issuecomment-1... https://github.com/helix-editor/helix/pull/211#issuecomment-...
    comment by celeritascelery · 2023-10-10 · in Text showdown: Gap Buffers vs. Ropes
  11. ▲ 13
    Please ask questions (rust-lang/regex)
    story by mfrw · 2023-08-28 · 2 comments
  12. …production due to catastrophic backtracking now takes on a physical meaning! Separately re: the OP, https://github.com/rust-lang/regex/issues/822 (and specifically BurntSushi's comment at the very end of the issue) adds really useful…
    comment by btown · 2023-07-05 · in Regex engine internals as a library
  13. …a sum type. Here's a "real" version of an AST for a regular expression in all its complex glory: https://github.com/rust-lang/regex/blob/a9b2e02352db92ce1f6e... You can see that it starts out as a sum type at the top level. And inside each…
    comment by burntsushi · 2023-03-14 · in Switching from C++ to Rust
  14. IIRC, that's what the Rust regex engine[1] currently uses [1] https://github.com/rust-lang/regex
    comment by SomeoneOnTheWeb · 2023-03-07 · in Show HN: Regex Derivatives (Brzozowski Derivatives)
  15. ▲ 3
    Is the Rust regex crate a bottleneck in your program? Can you share the details?
    story by asicsp · 2023-02-26 · 0 comments
  16. This applies to non-backtracking non-DFAs too: https://github.com/rust-lang/regex/issues/787#issuecomment-1... The GitHub issue comment is perhaps a bit high context. I wrote this reddit comment the other day that is lower context and…
  17. …a lot more useful. See for example people already running into problems with Discord's new feature: https://github.com/rust-lang/regex/issues/127#issuecomment-1... Of course, as I noted, it would be very inappropriate for Discord to permit…
  18. …regex crate has Unicode support. But it does not support \X. It's more precisely documented here: https://github.com/rust-lang/regex/blob/master/UNICODE.md
    comment by burntsushi · 2022-08-21 · in Brian Kernighan adds Unicode support to Awk
  19. …Feb 2020) [1], etc. [0]: https://github.com/rust-random/rand#rust-version-requirement... [1]: https://github.com/rust-lang/regex#minimum-rust-version-poli...
  20. …UTS#18 is a tortured document, but yes, the regex crate supports pretty much all of UTS#18 Level 1: https://github.com/rust-lang/regex/blob/master/UNICODE.md Going beyond Level 1 is difficult.
  21. …This document outlines Unicode support more precisely for ripgrep's underlying regex engine: https://github.com/rust-lang/regex/blob/master/UNICODE.md
  22. "Third-party" isn't really correct for regex: https://github.com/rust-lang/regex (note the org) Rust's stdlib is deliberately small in order to allow it to have very strong stability guarantees.
    comment by jhugo · 2022-04-11 · in Node.js packages don't deserve trust
  23. …than Andrew. [1]: https://blog.burntsushi.net/about [2]: https://github.com/BurntSushi/ripgrep [3]: https://github.com/rust-lang/regex [4]: https://github.com/BurntSushi/byteorder [5]: https://crates.io/crates?sort=recent-downloads
    comment by stouset · 2021-11-22 · in Rust Moderation Team Resigns
  24. …of my editing. There's a way to search through rope chunks by using the low level regex-automata: https://github.com/rust-lang/regex/issues/425#issuecomment-7... Alacritty currently does that to search over it's cells, I'd like to look…
    comment by archseer · 2021-06-02 · in Helix: a post-modern modal text editor
  25. Yes, yes and yes. :-) https://github.com/rust-lang/regex/blob/3db8722d0b204a85380f...
  26. …ripgrep already did a good job of dealing with common cases. This is ripgrep's current work-horse: https://github.com/rust-lang/regex/blob/3db8722d0b204a85380f... The revised algorithm is based on the same principles (heuristics derived…
  27. …But only in some cases. See https://github.com/BurntSushi/ripgrep/issues/617#issuecommen... and https://github.com/rust-lang/regex/issues/408 and https://github.com/rust-lang/regex/pull/419 Note though that it is going away soon. It's…
  28. …Discussions opened up, so it's appropriate to ask for help, even if they are beginner questions: https://github.com/rust-lang/regex/discussions As usual though, try to provide as many details as you can. Giving the source code you have but…
    comment by burntsushi · 2021-04-13 · in Rust is for Professionals
  29. …formulation used in Turon's paper wasn't amenable to large classes. Yes, interval sets work great: https://github.com/rust-lang/regex/blob/master/regex-syntax/... This is why I asked if a production grade regex engine based on derivatives…
    comment by burntsushi · 2021-03-14 · in Speed of Rust vs. C
  30. …a couple years since I looked closely, but last I checked, onig was not particularly fast. Compare https://github.com/rust-lang/regex/blob/master/bench/log/07/... vs https://github.com/rust-lang/regex/blob/master/bench/log/07/...
    comment by burntsushi · 2021-03-10 · in Debian Running on Rust Coreutils
  31. …that benchmark. So how does that change your conclusion? The regex crate has many more benchmarks: https://github.com/rust-lang/regex/blob/master/bench/log/07/... and https://github.com/rust-lang/regex/blob/master/bench/log/07/... for…
    comment by burntsushi · 2020-12-16 · in Minimal safe Bash script template
  32. …case it doesn't matter how many other fields there are in the type variant. Here is an example: https://github.com/rust-lang/regex/blob/master/regex-syntax/...
    comment by hlasdjlfhalwjk · 2020-08-10 · in Codata in action, or how to connect FP and OOP
  33. …And actual implementations based on these articles: https://github.com/google/re2 and https://github.com/rust-lang/regex
  34. ▲ 2
    Plan: Moving regex engines to regex-automata
    story by lukastyrychtr · 2020-03-27 · 0 comments
  35. …at that point, you'd be using the same regex engine. I even maintain official C bindings for them: https://github.com/rust-lang/regex/tree/master/regex-capi EDIT: Oh, and not sure if this is useful, but the regex crate itself should…
  36. > One such engine is rust's https://github.com/rust-lang/regex It can process arbitrary deep nestings? I'm not familiar with it, but I had a look and I can't see anything in there that would allow it to do it. Can you point to syntax that…
  37. …regex (as well as linear time with respect to the length of the input). One such engine is rust's https://github.com/rust-lang/regex
  38. ▲ 4
    Regular Expression Engine in Rust
    story by prataprc · 2019-05-24 · 0 comments
  39. I agree, this could be a nice project! If anyone wants to work on it, this is the place to start: https://github.com/rust-lang/regex/blob/master/src/literal/t... I'll get to it myself eventually if someone else doesn't, but it will likely…
    comment by burntsushi · 2019-04-16 · in Ripgrep 11 Released
  40. …isn't particularly good. I'll keep your advice about SSE 4.2 in mind should I revisit that code. https://github.com/rust-lang/regex/blob/master/src/literal/t... might be of interest to casual readers (not necessarily you, considering you…
    comment by blattimwind · 2019-03-30 · in Why GNU grep is fast (2010)
  41. …(or specifically, the Rust regex crate) takes inspiration from Hyperscan for its SIMD matching. https://github.com/rust-lang/regex/commit/203c509df9e1dcba61... Both libraries also rely on a number of techniques from existing published…
  42. …than the go one. [1] https://docs.rs/regex/1.1.0/regex/ [2] - C (and thus everything with a FFI): https://github.com/rust-lang/regex/tree/master/regex-capi - Go (heh): https://github.com/BurntSushi/rure-go - Possibly somewhat out of date…
  43. For Rust , many say that the regex crate sets a high standard for excellence: https://github.com/rust-lang/regex
  44. …something I'd like to work on. I don't know if I'll succeed, but I've documented my thoughts here: https://github.com/rust-lang/regex/issues/425 --- If you'd like to elaborate and go more in depth about the specific use cases you have, I'd…
  45. …this feature and a real-world implementation, check out the PR adding support to the regex library: https://github.com/rust-lang/regex/pull/456
    comment by kibwen · 2018-06-21 · in Announcing Rust 1.27
  46. …depending on whether they’re using nightly, with all the unstable features enabled, or not. [1] https://github.com/rust-lang/regex/pull/490
    comment by computerphage · 2018-06-21 · in Announcing Rust 1.27
  47. …for example will very rarely use Boyer Moore. Its work horse is much simpler and typically faster: https://github.com/rust-lang/regex/blob/master/src/literal/m... In Go-land, you should be able to replace uses of memchr with IndexByte[1],…
    comment by burntsushi · 2018-06-06 · in Show HN: Grep with colours written in Go
  48. ▲ 5
    Rust regex 1.0 released
    story by burntsushi · 2018-05-01 · 1 comment
  49. …C++ and D libraries), but they are very minimal bindings sufficient for rough microbenchmarking: https://github.com/rust-lang/regex/tree/master/bench/src/ffi
  50. …This behavior can be disabled with the '-I' flag, if needed. fd uses Rusts regex engine ( https://github.com/rust-lang/regex ) which is based on finite automata.